Closed brendan-rius closed 9 years ago
That is possible, take a look at https://github.com/sideshowcoder/canned#variable-responses using the header
.
As I understand it, it is possible to change the response being sent depending on the request headers. But I would like to add custom HTTP headers to the request.
I implemented this locally because it could not find it anywhere in the documentation/code
Ah sorry I see, yes that is currently not possible, yet it has been done specifically for the CORS headers but nothing else so far... PR would be very welcome. https://github.com/sideshowcoder/canned/blob/master/lib/response.js#L34
This would need to be extracted from the file I guess and then added to the response, from a first look it doesn't seem to complicated, as the content header is already passed down this way for example.
PR #70 should solve this
I would like to be able to add custom HTTP headers on responses so I can fake - for example - the login process (which returns a
Authorization
header)