postmates/PMHTTP

Consider making intercepted unmocked requests return 501 instead of 500

lilyball opened this issue · 0 comments

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.