forked from oznetmaster/SSharpWebSocketLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid HTTP request parsing in some network environments #1
Labels
Comments
I missed the braces in the logging line. The output is |
Fixed the formatting issue in 13d0931. |
With the HEAD version of this library, the bytes received for process input were: bytes_received = "47-45-54-20-2F-20-48-54-54-50-2F-31-2E-31-0D-0A-48-6F-73-74-3A-20-#{omitted}-3A-35-30-30-38-30-0D-0A-43-6F-6E-6E-65-63-74-69-6F-6E-3A-20-6B-65-65-70-2D-61-6C-69-76-65-0D-0A-55-70-67-72-61-64-65-2D-49-6E-73-65-63-75-72-65-2D-52-65-71-75-65-73-74-73-3A-20-31-0D-0A-55-73-65-72-2D-41-67-65-6E-74-3A-20-4D-6F-7A-69-6C-6C-61-2F-35-2E-30-20-28-57-69-6E-64-6F-77-73-20-4E-54-20-31-30-2E-30-3B-20-57-69-6E-36-34-3B-20-78-36-34-29-20-41-70-70-6C-65-57-65-62-4B-69-74-2F-35-33-37-2E-33-36-20-28-4B-48-54-4D-4C-2C-20-6C-69-6B-65-20-47-65-63-6B-6F-29-20-43-68-72-6F-6D-65-2F-35-38-2E-30-2E-33-30-32-39-2E-38-31-20-53-61-66-61-72-69-2F-35-33-37-2E-33-36-0D-0A-41-63-63-65-70-74-3A-20-74-65-78-74-2F-68-74-6D-6C-2C-61-70-70-6C-69-63-61-74-69-6F-6E-2F-78-68-74-6D-6C-2B-78-6D-6C-2C-61-70-70-6C-69-63-61-74-69-6F-6E-2F-78-6D-6C-3B-71-3D-30-2E-39-2C-69-6D-61-67-65-2F-77-65-62-70-2C-2A-2F-2A-3B-71-3D-30-2E-38-0D-0A-41-63-63-65-70-74-2D-45-6E-63-6F-64-69-6E-67-3A-20-67-7A-69-70-2C-20-64-65-66-6C-61-74-65-2C-20-73-64-63-68-0D-0A-41-63-63-65-70-74-2D-4C-61-6E-67-75-61-67-65-3A-20-65-6E-2D-55-53-2C-65-6E-3B-71-3D-30-2E-38-0D-0A-0D-0A"
text = bytes_received.split('-').reduce("") { |text, hex| text << hex.to_i(16).chr } # =>
"GET / HTTP/1.1\r\nHost: #{omitted}:50080\r\nConnection: keep-alive\r\nUpgrade-Insecure-Requests: 1\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\nAccept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-US,en;q=0.8\r\n\r\n" GET / HTTP/1.1
Host: #{omitted}:50080
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch\r\nAccept-Language: en-US,en;q=0.8
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue is reproducible across at least two processor types (DIN-AP3 and DMPS-300-C) but only on one enterprise-class network.
Issue
Error
Analysis
The property
WebSocketSharp.Net.HttpListenerRequest.UserHostAddress
is only supposed to be accessed if the incoming HTTP connection is an HTTP 1.0 connection and a host header is not provided. Nevertheless, it is being accessed in response to an HTTP 1.1 request fro several different user agents. For example, the error occurs withcurl
:curl -sv -o /dev/null http://$PROCESSOR_IP_ADDRESS:80/
Steps
WebSocketSharp.Net.HttpConnection processInput
to verify that the bytes transmitted from the client are the bytes received from the server.The text was updated successfully, but these errors were encountered: