tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

hsts.patch (1299B)


      1 diff --git a/mod_pywebsocket/handshake/base.py b/mod_pywebsocket/handshake/base.py
      2 index ffad0614d6bc4..12fa8ece25d03 100644
      3 --- a/mod_pywebsocket/handshake/base.py
      4 +++ b/mod_pywebsocket/handshake/base.py
      5 @@ -300,6 +300,9 @@ class HandshakerBase(object):
      6 
      7     def _set_protocol(self):
      8         self._request.ws_protocol = None
      9 +        # MOZILLA
     10 +        self._request.sts = None
     11 +        # /MOZILLA
     12 
     13         sec_websocket_protocol_header = self._transform_header(
     14             common.SEC_WEBSOCKET_PROTOCOL_HEADER)
     15 diff --git a/mod_pywebsocket/handshake/hybi.py b/mod_pywebsocket/handshake/hybi.py
     16 index cf931db5a506e..5290ea24fb6f6 100644
     17 --- a/mod_pywebsocket/handshake/hybi.py
     18 +++ b/mod_pywebsocket/handshake/hybi.py
     19 @@ -205,6 +205,12 @@ class Handshaker(HandshakerBase):
     20                     common.SEC_WEBSOCKET_EXTENSIONS_HEADER,
     21                     common.format_extensions(self._request.ws_extensions)))
     22 
     23 +        # MOZILLA
     24 +        if self._request.sts is not None:
     25 +            response.append(format_header("Strict-Transport-Security",
     26 +                                          self._request.sts))
     27 +        # /MOZILLA
     28 +
     29         # Headers not specific for WebSocket
     30         for name, value in self._request.extra_headers:
     31             response.append(format_header(name, value))