mirror of
				https://github.com/django/daphne.git
				synced 2025-11-04 01:27:33 +03:00 
			
		
		
		
	Fix non-websocket connection header parsing
This commit is contained in:
		
							parent
							
								
									cacce0493d
								
							
						
					
					
						commit
						a683fecfa6
					
				| 
						 | 
					@ -44,7 +44,7 @@ class WebRequest(http.Request):
 | 
				
			||||||
        if b"?" in self.uri:
 | 
					        if b"?" in self.uri:
 | 
				
			||||||
            self.query_string = self.uri.split(b"?", 1)[1]
 | 
					            self.query_string = self.uri.split(b"?", 1)[1]
 | 
				
			||||||
        # Is it WebSocket? IS IT?!
 | 
					        # Is it WebSocket? IS IT?!
 | 
				
			||||||
        if upgrade_header.lower() == b"websocket":
 | 
					        if upgrade_header and upgrade_header.lower() == b"websocket":
 | 
				
			||||||
            # Make WebSocket protocol to hand off to
 | 
					            # Make WebSocket protocol to hand off to
 | 
				
			||||||
            protocol = self.factory.ws_factory.buildProtocol(self.transport.getPeer())
 | 
					            protocol = self.factory.ws_factory.buildProtocol(self.transport.getPeer())
 | 
				
			||||||
            if not protocol:
 | 
					            if not protocol:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user