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

Remove user input from Bad Request responses #250

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/engineio/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ def handle_request(self, environ, start_response):
allowed_origins:
self._log_error_once(
origin + ' is not an accepted origin.', 'bad-origin')
r = self._bad_request(
origin + ' is not an accepted origin.')
r = self._bad_request('Not an accepted origin.')
start_response(r['status'], r['headers'])
return [r['response']]

Expand Down Expand Up @@ -381,11 +380,11 @@ def handle_request(self, environ, start_response):
else:
self._log_error_once('Invalid transport ' + transport,
'bad-transport')
r = self._bad_request('Invalid transport ' + transport)
r = self._bad_request('Invalid transport')
else:
if sid not in self.sockets:
self._log_error_once('Invalid session ' + sid, 'bad-sid')
r = self._bad_request('Invalid session ' + sid)
r = self._bad_request('Invalid session')
else:
socket = self._get_socket(sid)
try:
Expand All @@ -405,7 +404,7 @@ def handle_request(self, environ, start_response):
if sid is None or sid not in self.sockets:
self._log_error_once(
'Invalid session ' + (sid or 'None'), 'bad-sid')
r = self._bad_request('Invalid session ' + (sid or 'None'))
r = self._bad_request('Invalid session')
else:
socket = self._get_socket(sid)
try:
Expand Down