-
Notifications
You must be signed in to change notification settings - Fork 223
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
Addon should be active depending on content type of final request to page #172
Comments
If there's a way to get at that, I'd appreciate a PR that does that. |
I might take a shot at solving it some time. For now I just wanted to report it :) Edit: After a super quick look at the code, it might work to just filter away 3XX responses somewhere near here: https://github.com/bhollis/jsonview/blob/master/src/background.ts#L53 |
tlaundal
pushed a commit
to tlaundal/jsonview
that referenced
this issue
Aug 22, 2020
The content type header is irrelevant for redirect (status 300 to 400) responses, as they do not say anything about the content type of the actual resource they redirect to. This commit makes the extension silently ignore redirect responses. The resource at the end of the redirect is still handled properly. No special consideration is taken for status code 300 which will not make the browser create a new request, as the response body for these responses should already be made for display to the user. Fixes bhollis#172
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When navigating to an URL that responds with
303 See Other
andContent-Type: application/json
, JSONView tries to interpret the data at the redirected resource as JSON regardless of the content type returned with the redirected resource.Example flow:
example.com/redirect
example.com
responds with303 See Other
,Content-Type: application/json
andLocation: https://example.com/resource
example.com/resource
example.com
responds with200 OK
,Content-Type: text/html
and a webpageI've experienced this in an enterprise app, so I can not give an example link to a page with an example of this, unfortunately.
The text was updated successfully, but these errors were encountered: