Skip to content

Changing changeOrigin to be true by default #1132

Open
@patrickallaert

Description

@patrickallaert

As mentioned by @bdefore and @kdepp in #851, changeOrigin should be set to true by default.

The very first reason is simply to be compatible with the HTTP 1.1 specifications that requires a Host header. If a proxy listen on foobar.com and proxies request to bargee.net, then every requests sent to bargee.net must have a Host header set: Host: bargee.net.
In turns, by fixing the inconsistencies generated by changeOrigin=false, it will enable all virtual host environment to serve request correctly. This is the case for example when using http-proxy via grunt-connect-proxy that even dropped support for changeOrigin and requires injecting forcefully the host header.

IMHO, it would even be better to get rid of that option completely and consider it is always true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions