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

'preserveHostHdr' is not exposed in the user options #36

Open
9chu opened this issue Apr 23, 2021 · 0 comments
Open

'preserveHostHdr' is not exposed in the user options #36

9chu opened this issue Apr 23, 2021 · 0 comments

Comments

@9chu
Copy link

9chu commented Apr 23, 2021

The option preserveHostHdr is not assigned in the function resolveOptions but used in the function reqHeaders to determine if the proxy should bypass the Host param in the HTTP request header.

Which makes me cannot proxy requests from different domains to the same backend service.

The following patch will fix the issue:

--- lib/resolveOptions.js   2021-04-23 15:26:31.249257700 +0800
+++ lib/resolveOptions.js   2021-04-23 15:26:33.412777400 +0800        
@@ -15,6 +15,7 @@
   options = options || {};

   return {
+    preserveHostHdr: options.preserveHostHdr,
     proxyReqPathResolver:  options.proxyReqPathResolver,
     proxyReqOptDecorator: options.proxyReqOptDecorator,
     proxyReqBodyDecorator: options.proxyReqBodyDecorator,
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