Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Request Interceptors should be able to add custom headers to the http request #2377

Closed
jasadams opened this issue Apr 11, 2013 · 1 comment
Closed

Comments

@jasadams
Copy link

Currently it is possible to add a request interceptor and modify the config object for a http request before it is sent. I am able to add custom headers to the config object within an interceptor however these headers get ignored when the http request is constructed. I was able to fix this in my own fork by modifying the following line in the "serverRequest" function
from:

var reqData = transformData(config.data, headersGetter(headers), config.transformRequest);

to:

var reqData = transformData(config.data, headersGetter(extend(headers,config.headers)), config.transformRequest);
@jasadams
Copy link
Author

Closed this issue and opened pull request #2770

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant