(websocket server) Handle and accept firefox browser special upgrade value (keep-alive, Upgrade)
This commit is contained in:
		@@ -2,6 +2,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
All changes to this project will be documented in this file.
 | 
					All changes to this project will be documented in this file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [11.2.7] - 2021-05-27
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(websocket server) Handle and accept firefox browser special upgrade value (keep-alive, Upgrade)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [11.2.6] - 2021-05-18
 | 
					## [11.2.6] - 2021-05-18
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(Windows) move EINVAL (re)definition from IXSocket.h to IXNetSystem.h (fix #289)
 | 
					(Windows) move EINVAL (re)definition from IXSocket.h to IXNetSystem.h (fix #289)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -204,6 +204,9 @@ namespace ix
 | 
				
			|||||||
        // Check the value of the connection field
 | 
					        // Check the value of the connection field
 | 
				
			||||||
        // Some websocket servers (Go/Gorilla?) send lowercase values for the
 | 
					        // Some websocket servers (Go/Gorilla?) send lowercase values for the
 | 
				
			||||||
        // connection header, so do a case insensitive comparison
 | 
					        // connection header, so do a case insensitive comparison
 | 
				
			||||||
 | 
					        //
 | 
				
			||||||
 | 
					        // See https://github.com/apache/thrift/commit/7c4bdf9914fcba6c89e0f69ae48b9675578f084a
 | 
				
			||||||
 | 
					        //
 | 
				
			||||||
        if (!insensitiveStringCompare(headers["connection"], "Upgrade"))
 | 
					        if (!insensitiveStringCompare(headers["connection"], "Upgrade"))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            std::stringstream ss;
 | 
					            std::stringstream ss;
 | 
				
			||||||
@@ -296,7 +299,8 @@ namespace ix
 | 
				
			|||||||
            return sendErrorResponse(400, "Missing Upgrade header");
 | 
					            return sendErrorResponse(400, "Missing Upgrade header");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!insensitiveStringCompare(headers["upgrade"], "WebSocket"))
 | 
					        if (!insensitiveStringCompare(headers["upgrade"], "WebSocket") &&
 | 
				
			||||||
 | 
					            headers["Upgrade"] != "keep-alive, Upgrade") // special case for firefox
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return sendErrorResponse(400,
 | 
					            return sendErrorResponse(400,
 | 
				
			||||||
                                     "Invalid Upgrade header, "
 | 
					                                     "Invalid Upgrade header, "
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,4 +6,4 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IX_WEBSOCKET_VERSION "11.2.6"
 | 
					#define IX_WEBSOCKET_VERSION "11.2.7"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user