WebSocket-for-Python icon indicating copy to clipboard operation
WebSocket-for-Python copied to clipboard

Lack of trailing slash creates invalid GET call

Open jefferai opened this issue 13 years ago • 2 comments

If you use a line like ws = EchoClient('wss://myserver.org:443') you get an invalid GET request:

0000 47 45 54 20 20 48 54 54 50 2f 31 2e 31 0d 0a 48 GET HTTP/1.1..H

Note the lack of a / there between the GET and HTTP/1.1.

Using ws = EchoClient('wss://myserver.org:443/') works as expected.

Lack of a trailing slash when requesting a site's root really ought to be handled properly.

jefferai avatar Aug 17 '12 03:08 jefferai

I agree this should be transparent to the client but currently the implementation doesn't make it easy.

Lawouach avatar Sep 11 '13 19:09 Lawouach

Could anyone tell me how to reproduce this? Tracing the traffic by ngrep shows that it is always GET / HTTP/1.1 whenever there is a trailing slash. On the other hand, self.resource, which is the header element between GET and HTTP 1.1, is / in both case. Or maybe the bug is due to cURL?

neofyte avatar Sep 14 '13 03:09 neofyte