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.
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.