Skip to content

Redirect-following error (HTTP -> HTTPS + naked domain -> www subdomain) #570

@buu700

Description

@buu700

Steps to reproduce (tested with Node 8.12.0 and 11.7.0):

git clone https://github.com/buu700/simple-reverse-proxy
cd simple-reverse-proxy
npm install
npm start &
curl -H 'Host: cyph.com' http://localhost/wp-content/uploads/2018/10/auditconclusion.txt

Expected result: Prints content of https://www.cyph.com/wp-content/uploads/2018/10/auditconclusion.txt

Actual result: FetchError: maximum redirect reached at: https://www.cyph.com/wp-content/uploads/2018/10/auditconclusion.txt

Note that it works as expected when changing either the Host header to www.cyph.com or the origin to https://localhost (or both); it's only when redirecting from http://cyph.com -> https://cyph.com -> https://www.cyph.com that the failure occurs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions