mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
fix: do not overwrite CORS headers upon error
The Access-Control-Allow-xxx headers added by the cors middleware were
overwritten when sending an error response.
Those lines should have been removed in [1].
[1]: 61b949259e
Related: https://github.com/socketio/engine.io/issues/605
This commit is contained in:
@@ -475,12 +475,6 @@ function sendErrorMessage(req, res, code) {
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (req.headers.origin) {
|
||||
headers["Access-Control-Allow-Credentials"] = "true";
|
||||
headers["Access-Control-Allow-Origin"] = req.headers.origin;
|
||||
} else {
|
||||
headers["Access-Control-Allow-Origin"] = "*";
|
||||
}
|
||||
if (res !== undefined) {
|
||||
res.writeHead(400, headers);
|
||||
res.end(
|
||||
|
||||
Reference in New Issue
Block a user