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

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

@9chu

Description

@9chu

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions