Skip to content

Handle 300 status codes better #326

Open
@jakerella

Description

@jakerella

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions