Skip to content

Commit cd7c340

Browse files
authored
Merge pull request #74 from 0xR/remove-host-header
Don't proxy host header
2 parents e77699a + 4b885c8 commit cd7c340

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ const resolver = (endpoint: Endpoint, proxyUrl: ?(Function | string), customHead
3838
const proxy = !proxyUrl ? opts.GQLProxyBaseUrl : (typeof proxyUrl === 'function' ? proxyUrl(opts) : proxyUrl);
3939
const req = endpoint.request(args, proxy);
4040
if (opts.headers) {
41-
req.headers = Object.assign(customHeaders, req.headers, opts.headers);
41+
const { host, ...otherHeaders } = opts.headers;
42+
req.headers = Object.assign(customHeaders, req.headers, otherHeaders);
4243
}
4344
const res = await rp(req);
4445
return JSON.parse(res);

0 commit comments

Comments
 (0)