jquery-mockjax icon indicating copy to clipboard operation
jquery-mockjax copied to clipboard

Handle 300 status codes better

Open jakerella opened this issue 7 years ago • 1 comments

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 avatar Jan 07 '18 15:01 jakerella

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

jakerella avatar Jan 07 '18 18:01 jakerella