Firefox with a "201 created" response should perform a redirect to the Location field
Categories
(Core :: Networking: HTTP, defect, P3)
Tracking
()
People
(Reporter: andy, Unassigned)
Details
(Whiteboard: [necko-backlog])
Updated•18 years ago
|
Comment 1•18 years ago
|
||
| Reporter | ||
Comment 2•18 years ago
|
||
Updated•10 years ago
|
Comment 3•9 years ago
|
||
Comment 4•9 years ago
|
||
I can confirm this is still an issue. I'm on 83.0, macOS (Intel-based) Big Sur. My test setup was slightly different but effectively the same:
let express = require('express');
const app = express()
app.get('/', (req, res) => {
res.status(201);
res.set('Location', '/redirected');
console.log('Set headers.');
res.end();
});
app.get('/redirected', (req, res) => {
res.status(200);
res.set('Content-Type', 'text/plain');
res.send('Hello, World!');
console.log('Redirected!');
res.end();
});
app.listen(5000, () => {
console.log("Started listening.");
});
I wonder if a redirect should be done at all. From https://httpstatuses.com/201, "The request has been fulfilled and has resulted in one or more new resources being created.", and "The 201 response payload typically describes and links to the resource(s) created." This response code therefore seems to indicate that the request has been fulfilled by the creation of a resource. It is the payload's duty to indicate this to the user.
I'm new to the code base, but from my understanding, this function handles response status codes that are redirects (i.e., 3xx status codes).
@jstutte Perhaps we should close this issue?
Comment 7•5 years ago
|
||
Thanks for the analysis! I'd agree.
Description
•