-
Notifications
You must be signed in to change notification settings - Fork 97
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
304 responses fail with as:'json' interceptor #104
Comments
Have you tried proxy.intercept({
phase: 'response',
mimeType: /json/,
as: 'json'
}, function(req, resp, cycle) {
// ...
}); In any case, Hoxy doesn't have the ability to filter on status code but that definitely seems like a useful feature, and fits with how filtering is done in general. It wouldn't be hard to add. Then you could do: proxy.intercept({
phase: 'response',
mimeType: /json/,
status: 200,
as: 'json'
}, function(req, resp, cycle) {
// ...
}); I may look into adding it when I get some time. PRs also definitely welcome too :) |
I agree that the server shouldn't send a I'll try to carve out some time to put a PR together for the |
Hahahaha... such is life :P |
With an
as: 'json'
interceptor, Proxy attempts toJSON.parse
the response body, regardless ofresponse.statusCode
. Ideally, this would be skipped and the interceptor callback would be called with some indication of the 304 status code andresponse.json
asundefined
. Even better, would be an interceptor filter onresponse.statusCode
forresponse
andresponse-sent
phases. Just a thought!The text was updated successfully, but these errors were encountered: