Skip to content

Commit

Permalink
Fix browsertrix WebSocket proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Aug 21, 2023
1 parent 30e71af commit dcf0bf8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reproserver/web/webcapture.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ def get(self, upload_short_id, run_short_id):


class CrawlStatusWebsocket(WebSocketHandler, BaseHandler):
upstream_ws = None

def get(self, upload_short_id, run_short_id):
# Decode info from URL
try:
Expand Down Expand Up @@ -566,7 +568,8 @@ def on_upstream_message(self, message):
return self.write_message(message, isinstance(message, bytes))

def on_ws_connection_close(self, close_code=None, close_reason=None):
self.upstream_ws.close(close_code, close_reason)
if self.upstream_ws is not None:
self.upstream_ws.close(close_code, close_reason)


class UploadWacz(BaseHandler):
Expand Down

0 comments on commit dcf0bf8

Please sign in to comment.