Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 200 proxy redirects do not seem to work correctly in netlify dev #4561

Closed
fool opened this issue Apr 22, 2022 · 2 comments
Closed

HTTP 200 proxy redirects do not seem to work correctly in netlify dev #4561

fool opened this issue Apr 22, 2022 · 2 comments
Labels
type: bug code to address defects in shipped code

Comments

@fool
Copy link
Contributor

fool commented Apr 22, 2022

Describe the bug

HTTP 200 redirects seem to be mishandled under netlify dev, returning a location header incorrectly.

There should be no location set on an HTTP 200 proxy rule; we should only serve the content. Said redirect does work as expected in production, and I believe that production is correct here.

Steps to reproduce

When running netlify dev with a 200 status redirect like this:

/:placeholder/signup/page.html /:placeholder/signup.html 200!

then, using cURL to test locally, we see this response:

% curl -I http://localhost:3000/en-us/signup/page.html
HTTP/1.1 200 OK
etag: W/"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"
location: /en-us/signup.html
date: Fri, 22 Apr 2022 05:37:37 GMT
connection: close

Configuration

n/a

Environment

 System:
    OS: macOS 11.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 479.76 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
  npmGlobalPackages:
    netlify-cli: 10.0.0
@fool fool added the type: bug code to address defects in shipped code label Apr 22, 2022
@tinfoil-knight
Copy link
Contributor

@fool I've not been able to reproduce the issue.

I created a directory with redirect as specified. I'm not getting the location header from curl.

% curl -I "http://localhost:8888/en-us/signup/page.html"

HTTP/1.1 200 OK
etag: W/"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"
x-powered-by: netlify-dev
date: Sat, 06 Aug 2022 11:40:17 GMT
content-type: text/html
content-length: 106
connection: close

Repo: https://github.com/KK-Learning-Gym/4561-redirect-200

CLI Version: 10.15.0

@danez
Copy link
Contributor

danez commented Aug 26, 2022

Also not able to reproduce this anymore. #5005 includes tests that actually test this.

@danez danez closed this as completed Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants