Skip to content

Commit

Permalink
URL must be re-encoded when doing redirect (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
meejah authored Dec 18, 2020
1 parent c08e9e3 commit f7b7ad5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autobahn/websocket/protocol.py
Original file line number Diff line number Diff line change
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

0 comments on commit f7b7ad5

Please sign in to comment.