-
Notifications
You must be signed in to change notification settings - Fork 567
Description
I have an issue similar to #331 but related to the error situations which are eventually handled by the sendErrorMessage (https://github.com/socketio/engine.io/blob/master/lib/server.js#L236)
I have socket.io configured to allow only certain origins and in case of origin that is not passing validation I can see verify method failing (https://github.com/socketio/engine.io/blob/master/lib/server.js#L159) due to not allowed request. Unfortunately the error response generated by sendErrorMessage is having that unallowed origin set in Access-Control-Allow-Origin header which is
a) a bit confusing as my response about not allowed origin at the same time claims to allow it via Access-Control-Allow-Origin header
b) such responses are picked up by the security scans
Is there any reason sendErrorMessage explicitly sets the CORS headers? Could we add some way to somehow control their presence?