Skip to content
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

Handle 300 status codes better #326

Open
jakerella opened this issue Jan 7, 2018 · 1 comment
Open

Handle 300 status codes better #326

jakerella opened this issue Jan 7, 2018 · 1 comment

Comments

@jakerella
Copy link
Owner

This came out of PR #79, but that PR is closed for inactivity. We would want to be able to handle 301, 302, 304, 305, and 307 - although this could all be separate issues/PRs.

Adding custom headers to the response is actually easy, but the issue is that XMLHttpRequest is supposed to "silently" follow a 302 (for example) and thus ultimately return the status code from that second request, not the first. We need Mockjax to follow this rule, which essentially means making another ajax call on 302 (or whatever). If that new request is not mocked, then it would go through, but the developer could always mock both the original and redirect endpoints.

@jakerella
Copy link
Owner Author

jakerella commented Jan 7, 2018

Started working on this in #328 (basic support for 301 and 302)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant