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

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

Open
lilyball opened this issue Oct 16, 2018 · 0 comments
Open
Milestone

Comments

@lilyball
Copy link
Collaborator

lilyball commented Oct 16, 2018

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.

lilyball added a commit that referenced this issue Apr 24, 2019
@lilyball lilyball added this to the 5.0 milestone Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant