-
Notifications
You must be signed in to change notification settings - Fork 839
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
Overwrite default headers with undefined #1396
Comments
This sounds like a bug; can you please provide a live example on Plunkr? |
https://plnkr.co/edit/5HiwmcxBGmd2wudbsPhK?p=preview Use console to check the resulting request headers. I've provided comments in the script. I've provided wrong description to the problem, so allow me correct myself. The withHttpConfig in general doesn't work with headers. No provided header is used. The behavior described above is for the optional headers one can provide for most of the defined request methods provided by restangular. |
Yikes. That is a bug. Would you mind submitting a PR to fix this? |
Is this fixed yet? |
Is there a way to set the default headers to undefined for a single request?
I'm well aware of the optional headers
withHttpConfig, but it ignores undefined value(bug?), i.e. uses the default value, sets it to null when null is used and uses the default value when an empty object literal is given as the headers.withHttpConfig doesn't in general work with headers, i.e. no provided value is used.
Use case:
The server uses the Authorization header as a scoping mechanism, where it has a different scope depending on whether there is an Authorization header.
We deal with the scoping by using default headers, but sometimes we've to do a single request in a different scope and would rather not unset and set default headers for that matter.
The text was updated successfully, but these errors were encountered: