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

URL must be re-encoded when doing redirect #1439

Merged
merged 1 commit into from Dec 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion autobahn/websocket/protocol.py
Expand Up @@ -58,6 +58,7 @@
from autobahn.util import _maybe_tls_reason

import txaio
import hyperlink


__all__ = ("WebSocketProtocol",
Expand Down Expand Up @@ -2646,7 +2647,8 @@ def processHandshake(self):
#
# https://localhost:9000/?redirect=https%3A%2F%2Ftwitter.com%2F&after=3
#
url = self.http_request_params['redirect'][0]
url = hyperlink.URL.from_text(self.http_request_params['redirect'][0])
url = url.to_uri().normalize().to_text()
if 'after' in self.http_request_params and len(self.http_request_params['after']) > 0:
after = int(self.http_request_params['after'][0])
self.log.debug(
Expand Down