-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http response code 302 displays error msg #15
Comments
Well, for an Ajax-based response, a 30x response isn't ideal. Can you shoot through the headers for the response back from the controller? The controller should detect an ajax request and respond with a payload, rather than a redirect (302) response. |
The response header includes a X-Redirect. I think it is caused somewhere in the Response Headers
The Response payload seems perfectly fine though: |
You mentioned you're using Custom Form Templates, are you using the default theme JS or rolling your own? I'll try and re-create this and see how I go, if we want to change that. I was more concerned about a 30x response for an Ajax request isn't correct in any case. I'll get back to you after testing. |
I am using the default JS. |
Just circling back to this, can you send through your request headers, not just the response headers? It seems like something might be going on with |
Request Headers
|
Thanks for this. Is your site a multi-site? Is there some redirection going on for |
Hi Josh, I got to the bottom of this. The redirect is caused by another custom made plugin of ours. |
Ah, glad you got to the bottom of it. I'll still consider allowing 30x responses not marked as errors for ajax-based requests. |
Well maybe there should not be redirects in POST requests. |
For an Ajax request there shouldn't be any legitimate reason you get a redirect response from Craft, hence why I was trying to see if it was a deeper issue. If there's a redirect setup for a successful form entry, its done through JS. For traditional POST-ing to the server, again, the only redirect response you should receive is if you have redirection setup for a successful submission |
Description
Form submitted via ajax displays error message "Couldn’t save submission due to errors. 302: Found"
In src/web/assets/frontend/src/js/formie-form.js is says
shouldn't it be
< 400
instead as 30x codes do not necessarily indicate errors?
Form settings
Additional info
The text was updated successfully, but these errors were encountered: