From 4b885c8bf9668388b6c87d6792451de7ce822046 Mon Sep 17 00:00:00 2001 From: Ruben Oostinga Date: Sat, 19 May 2018 11:22:50 +0200 Subject: [PATCH] Don't proxy host header --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 402d4ae..9e50b16 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,8 @@ const resolver = (endpoint: Endpoint, proxyUrl: ?(Function | string), customHead const proxy = !proxyUrl ? opts.GQLProxyBaseUrl : (typeof proxyUrl === 'function' ? proxyUrl(opts) : proxyUrl); const req = endpoint.request(args, proxy); if (opts.headers) { - req.headers = Object.assign(customHeaders, req.headers, opts.headers); + const { host, ...otherHeaders } = opts.headers; + req.headers = Object.assign(customHeaders, req.headers, otherHeaders); } const res = await rp(req); return JSON.parse(res);