Skip to content

Consider making intercepted unmocked requests return 501 instead of 500 #46

@lilyball

Description

@lilyball

Currently when asking the mock manager to intercept unmocked requests, it does so by making them return a 500 Internal Server Error. We may want to change this to return a 501 Not Implemented error instead.

If we do this, we should also remember to specify a Cache-Control: no-store header as 501 is implicitly cacheable.

We may also want to expose an API to test for "does this response represent an unmocked intercepted request?". One possible approach here is to subclass HTTPURLResponse and use that. Another is to return a custom header like X-PMHTTP-Mock: unmocked and then test for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions