summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/xpra-4.0.4-norequests.patch
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2020-10-16 19:15:41 +0200
committerLudovic Courtès <ludo@gnu.org>2020-10-17 22:40:18 +0200
commit21fdf429a7bb6a7d371fcf1d5b5a892fb9c5cdfc (patch)
treef4dd8080b342b262d09298cfffed116b99e57324 /gnu/packages/patches/xpra-4.0.4-norequests.patch
parentf54149062e769a493207033514401d4f3890bded (diff)
gnu: xpra: Fix HTML server
* gnu/packages/patches/xpra-4.0.4-norequests.patch: Add file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/xorg.scm (xpra)[patches]: Apply it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/patches/xpra-4.0.4-norequests.patch')
-rw-r--r--gnu/packages/patches/xpra-4.0.4-norequests.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/gnu/packages/patches/xpra-4.0.4-norequests.patch b/gnu/packages/patches/xpra-4.0.4-norequests.patch
new file mode 100644
index 0000000000..e545be7f1d
--- /dev/null
+++ b/gnu/packages/patches/xpra-4.0.4-norequests.patch
@@ -0,0 +1,39 @@
+Remove python-requests dependency, r27626 upstream.
+
+--- a/xpra/net/websockets/common.py (revision 27625)
++++ b/xpra/net/websockets/common.py (revision 27626)
+@@ -7,7 +7,6 @@
+ import uuid
+ from hashlib import sha1
+ from base64 import b64encode
+-from requests.structures import CaseInsensitiveDict
+
+ from xpra.os_util import strtobytes, bytestostr, monotonic_time
+ from xpra.log import Logger
+@@ -77,7 +76,7 @@
+ for line in lines:
+ parts = line.split(b": ", 1)
+ if len(parts)==2:
+- headers[parts[0]] = parts[1]
++ headers[parts[0].lower()] = parts[1]
+ return headers
+
+ def verify_response_headers(headers, key):
+@@ -84,14 +83,13 @@
+ log("verify_response_headers(%s)", headers)
+ if not headers:
+ raise Exception("no http headers found in response")
+- headers = CaseInsensitiveDict(headers)
+- upgrade = headers.get(b"Upgrade", b"")
++ upgrade = headers.get(b"upgrade", b"")
+ if upgrade!=b"websocket":
+ raise Exception("invalid http upgrade: '%s'" % upgrade)
+- protocol = headers.get(b"Sec-WebSocket-Protocol", b"")
++ protocol = headers.get(b"sec-websocket-protocol", b"")
+ if protocol!=b"binary":
+ raise Exception("invalid websocket protocol: '%s'" % protocol)
+- accept_key = headers.get(b"Sec-WebSocket-Accept", b"")
++ accept_key = headers.get(b"sec-websocket-accept", b"")
+ if not accept_key:
+ raise Exception("websocket accept key is missing")
+ expected_key = make_websocket_accept_hash(key)