Malformed HTTP Request using BOSH
Reported by bseibold:
bug description
Connecting to Servers via BOSH might fail due to malformed HTTP requests from nbxmpp
bug analysis
Wireshark shows that nbxmpp sends HTTP requests like this:
POST http://jabber.e404.de:5280/http-bind HTTP/1.1
Host: jabber.e404.de:5280
...
Using the complete URI after the POST is invalid, only the path /http-bind
should be used.
fix recommendation
diff -r 0c337cf01ae4 nbxmpp/transports_nb.py
--- a/nbxmpp/transports_nb.py Sat Oct 04 22:25:11 2014 +0200
+++ b/nbxmpp/transports_nb.py Tue Nov 04 21:13:55 2014 +0100
@@ -766,9 +766,7 @@
Builds http message with given body. Values for headers and status line
fields are taken from class variables
"""
- absolute_uri = '%s://%s:%s%s' % (self.http_protocol, self.http_host,
- self.http_port, self.http_path)
- headers = ['%s %s %s' % (method, absolute_uri, self.http_version),
+ headers = ['%s %s %s' % (method, self.http_path, self.http_version),
'Host: %s:%s' % (self.http_host, self.http_port),
'User-Agent: Gajim',
'Content-Type: text/xml; charset=utf-8',