-
Notifications
You must be signed in to change notification settings - Fork 138
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
Set Content-Type to application/json; charset=UTF-8
#1171
Comments
Hey @chrstophg, it's because that type still allowed for "Simple CORS", and our RPC api didn't really care as it parses everything as JSON. I'm not sure if the batching API supports CORS today, I think so but would need to check -- the default tracking API (/t) does as of a couple years ago, but we still may want to use text/plain as CORS introduces the modest overhead of preflight requests. Also, utf charset thing is not needed AFAIK, JSON is by default utf-8 :-) Is there a particular reason you care about the content type? |
We're setting up a backend proxy for events, and Thanks for the explanation 👍 . |
Would you be open to allow custom headers to be passed to the |
@chrstophg this isn't something we support at the moment unfortunately, and we probably would want to implement this ourselves by supporting more client options or a custom fetch implementation. We typically would create a spec, but very short of resources. This is tracked in #392 FYI ATM, the only workaround would be if you could monkey patch window.fetch on your end. |
Hey!
Currently the
Content-Type
header is set totext/plain
, like here for the batch calls. Since we're sending JSON, should this be updated toapplication/json; charset=UTF-8
, or is there any reason I'm not aware of to usetext/plain
?The text was updated successfully, but these errors were encountered: