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

Update JsonpMediaTypeFormatter.cs #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jthomas077
Copy link

Line 104: Modification to process non-jsonp requests within the same context. i.e. POST, PUT, PATCH, DELETE, etc. Currently, it will throw the InvalidOperationException if a callback is not present, thus failing non-GET requests.

Line 104: Modification to process non-jsonp requests within the same context. i.e. POST, PUT, PATCH, DELETE, etc. Currently, it will throw the InvalidOperationException if a callback is not present, thus failing non-GET requests.
@panesofglass
Copy link
Member

I can't tell exactly what you are trying to do in this PR. The goal of this formatter is to add it to the bottom of the list and allow the default JSON formatter to run for all other requests, allowing this one to handle requests with a correct Accept header for valid or often used JSONP media types. Earlier attempts tried to allow the same formatter to be used to service all JSON and JSONP requests, but there are both security vulnerabilities and other issues I've since forgotten, some having to do with mismatched Content-Type headers.

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

Successfully merging this pull request may close these issues.

2 participants