Replies: 4 comments 1 reply
-
have you tried chrome://net-internals/#hsts? |
Beta Was this translation helpful? Give feedback.
-
Tested with the same code on Express 5.0.1 using a basic HTTP server. Sent a POST request via Postman—redirect stayed on HTTP (Location: /), no switch to HTTPS. If HTTPS shows up, something in the environment (like a proxy, VPN, or Postman setting) might be affecting it. Worth checking the raw response headers to confirm. |
Beta Was this translation helpful? Give feedback.
-
Yes I tried chrome hsts way |
Beta Was this translation helpful? Give feedback.
-
@Amanp30 btw what happens if you force redirect ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When running an Express.js application in a local development environment (served over HTTP), I'm observing an unexpected redirect to HTTPS when performing res.redirect('/') from a POST route. This behavior does not occur when redirecting from a GET route to a relative path, or when redirecting to a non-root path.
Steps to Reproduce:
Set up a basic Express.js application locally, explicitly configured to serve over HTTP (e.g., using const http = require("http"); http.createServer(app).listen(PORT);).
Define a simple POST route that performs a redirect to the root path:
From a client (e.g., Postman, browser fetch API, or a simple HTML form), send a POST request to http://localhost:PORT/test-post-redirect.
Expected Behavior:
The browser should redirect to http://localhost:PORT/.
Actual Behavior:
The browser redirects to https://localhost:PORT/.
Express version 5.0.1
Beta Was this translation helpful? Give feedback.
All reactions