Replies: 1 comment
-
I don't quite have the use case. However, I have a special plugin on my work computer that sets certain headers depending on the domain. With e.g HTTPYAC_PLUGIN=~/.httpyac.js module.exports = {
configureHooks: function (api) {
api.hooks.onRequest.addHook('addHeader', function (request, {variables}) {
if(request.url.indexOf("example.com") >= 0){
request.headers.authorization = `Bearer ${variables.token}`;
}
});
}
} Any good ideas on how I can generalize this? I just haven't had a good way how to define env specific default headers. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to workout a scheme where
defaultHeaders
are set based on environment. I tried something like this, but it didn't quiet work. Any ideas on what I could do?Beta Was this translation helpful? Give feedback.
All reactions