Closed
Bug 1295931
Opened 8 years ago
Closed 8 years ago
[Firefox 48] 400 Bad request when I request a websocket connection and Never Remember History is turned on
Categories
(Core :: Networking: WebSockets, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: sw.cheung, Assigned: mayhemer)
Details
(Whiteboard: [necko-active])
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 Build ID: 20160811031722 Steps to reproduce: When I used Firefox 45 the request of websocket connection had no problem. Recently, I upgraded the Firefox, its version is 48. and then I request the connection with the following HTTP header GET /StreamingServer/ HTTP/1.1 Host: 192.168.123.54 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Sec-WebSocket-Version: 13 origin: http://192.168.123.54 Sec-WebSocket-Extensions: permessage-deflate Sec-WebSocket-Key: ng+5fTZv46kgx2hj/LFBPQ== Cookie: PHPSESSID=e9v9ceu9t1at0q1c7ppmi54p95 Connection: keep-alive, Upgrade Pragma: no-cache Cache-Control: no-cache Upgrade: websocket Actual results: After then the websocket request did not work. Always a bad request had been returned as the following. HTTP/1.1 400 Bad Request Access-Control-Allow-Origin: http://192.168.123.54 Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: Authorization, Content-Type, If-None-Match Access-Control-Expose-Headers: WWW-Authenticate, Server-Authorization Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, OPTIONS Access-Control-Max-Age: 60 Cache-Control: public, max-age=2 Content-Type: text/html Content-Length: 349 Date: Wed, 17 Aug 2016 10:22:46 GMT Server: lighttpd/1.4.35 Expected results: I wonder why the request got the bad request error. The wierd thing is the issue has been resolved when I set "Option > Privary > History : FireFox will : Never remember history" .
Comment 1•8 years ago
|
||
Firefox: 48.0.1, Build ID: 20160817112116 User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0 Hi Cheung, Can you please provide a minimal test case in order to test this issue? I have tested this using a created local page, but I could not reproduce this issue. Also, can you please retest this using latest Nightly build (https://nightly.mozilla.org/) and report back the results ? When doing this, please use a new clean Firefox profile, maybe even safe mode, to eliminate custom settings as a possible cause (https://goo.gl/PNe90E).
Component: Untriaged → Networking: WebSockets
Flags: needinfo?(sw.cheung)
Reporter | ||
Comment 2•8 years ago
|
||
(In reply to Cosmin Muntean [:CosminMCG] from comment #1) > Firefox: 48.0.1, Build ID: 20160817112116 > User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 > Firefox/48.0 > > Hi Cheung, > > Can you please provide a minimal test case in order to test this issue? I > have tested this using a created local page, but I could not reproduce this > issue. > > Also, can you please retest this using latest Nightly build > (https://nightly.mozilla.org/) and report back the results ? When doing > this, please use a new clean Firefox profile, maybe even safe mode, to > eliminate custom settings as a possible cause (https://goo.gl/PNe90E). Hello. Mustine Thank you for your reply and test. First, I have tried your suggestion. Unfortunately, I did not work. So I would like to provide a simple test page I tried as follows. Regards. --------- <!DOCTYPE HTML> <html> <head> <script type="text/javascript"> function WebSocketTest() { if ("WebSocket" in window) { alert("WebSocket is supported by your Browser!"); // Let us open a web socket var ws = new WebSocket("ws://192.168.138.231/StreamingServer"); ws.binaryType = 'arraybuffer'; ws.onopen = function() { alert("Websocket Open!!"); ws.send("Message to send"); alert("Message is sent..."); }; ws.onmessage = function (evt) { var received_msg = evt.data; alert("Message is received... " + received_msg); }; ws.onerror = function (error) { console.log("Websocket error ! "+error); }; ws.onclose = function() { // websocket is closed. alert("Connection is closed..."); }; } else { // The browser doesn't support WebSocket alert("WebSocket NOT supported by your Browser!"); } } </script> </head> <body> <div id="sse"> <a href="javascript:WebSocketTest()">Run WebSocket</a> </div> </body> </html>
Assignee | ||
Comment 3•8 years ago
|
||
Sweungwon, thanks for the test case, but it's not enough to reproduce the problem for us. What we also need is the server. The address 192.168.138.231 suggests that it is a server running only in your local network, inaccessible from outside. Hence, I'd like to ask you to produce a log file, please see [1] on how to do it. Please add nsWebSocket:5 module to the NSPR_LOG_MODULES environment variable as well, so it should look like: NSPR_LOG_MODULES=timestamp,rotate:200,nsHttp:5,nsSocketTransport:5,nsStreamPump:5,nsHostResolver:5,nsWebSocket:5 Then run Firefox and reproduce the problem (just the problem, best in a clean profile). Thanks. [1] https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging
Assignee: nobody → honzab.moz
Whiteboard: [necko-active]
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(sw.cheung)
Assignee | ||
Comment 5•8 years ago
|
||
Sweungwon, please set: NSPR_LOG_MODULES=timestamp,rotate:200,nsHttp:5,nsSocketTransport:5,nsStreamPump:5,nsHostResolver:5,nsWebSocket:5 and run again. the log you've sent is not sufficient.
Flags: needinfo?(sw.cheung)
Reporter | ||
Comment 6•8 years ago
|
||
Dear Bambas. I sent the log again after resetting the configuration. Plase check your email. Regards.
Assignee | ||
Comment 7•8 years ago
|
||
The reporter sent me two logs, both from Fx48. One with Never remember history 'OFF' (default), which gets a 400 response to web socket request. Other one with Never remember history 'ON' which receives expected 101 Protocol Switch response. I can see that in the 400 case we send the "origin" header name all lower case. In the 101 case we send it 'correctly' as "Origin". I can't see in the log where this is set wrong, but something tells me that some code related PB mode might be involved. Jason, are you aware of any recent changes in WebSocket code regarding origin request header and PB mode?
Flags: needinfo?(sw.cheung) → needinfo?(jduell.mcbugs)
Summary: Firefox 48 : Error, bad request return when I request a websocket connection → [Firefox 48] 400 Bad request when I request a websocket connection and Never Remember History is turned on
Assignee | ||
Comment 8•8 years ago
|
||
Thanks Sweungwon for all the logs and info you provided in private mails! This is not a Firefox/Gecko bug. The lighttpd server is not willing to accept "origin" header in the lower case form. And, apparently, some add-on is messing with the header name (not us). Closing as INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(jduell.mcbugs)
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•