-
Notifications
You must be signed in to change notification settings - Fork 211
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
Client request pre-pends accept header when provided in options #153
Comments
This is the code that does it... Lines 101 to 105 in 6daa7a5
|
@jmandel found this and confirmed that this is indeed the behavior of fetch, it scans case insensitive in order, hence finding the base provided one first, then the ones provided in the options. |
Maybe a test like this before setting the accept header. |
Yes, that will need fixing. Please use lowercased header names until a fix is released. Fetch just does the best it can by "merging" these into single value, which is slightly better than ignoring one of them. There is no reliable way to solve this though, so this library should make sure it does not happen and merge headers itself before fetch is called. |
Should be fixed and released in |
If I try to provide the accept headers in the request options to a client request the client injects the
application/json
to the front like this:application/json, application/fhir+json; fhirVersion=4.0, application/fhir+json
This is my test code snippit (was trying to test using the signal to abort long running requests)
The behaviour should be to either:
The interpretation of the header by the server is to scan through and stop when it finds one that it supports (not try and work out what is the most specific)
The text was updated successfully, but these errors were encountered: