Skip to content

Commit

Permalink
websocket: set follow_redirects to False
Browse files Browse the repository at this point in the history
to prevent silent failure when the websocket client gets a 3xx
redirect response, because it does not currently support redirects

Partial fix for issue #2405
  • Loading branch information
vivamexico authored and ploxiln committed Sep 22, 2020
1 parent 94f155d commit d7dedcf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tornado/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,9 @@ def websocket_connect(
request.headers = httputil.HTTPHeaders(request.headers)
else:
request = httpclient.HTTPRequest(url, connect_timeout=connect_timeout)
# Websocket connection is currently unable to follow redirects
request.follow_redirects = False

request = cast(
httpclient.HTTPRequest,
httpclient._RequestProxy(request, httpclient.HTTPRequest._DEFAULTS),
Expand Down

0 comments on commit d7dedcf

Please sign in to comment.