mirror of
				https://github.com/django/daphne.git
				synced 2025-11-04 09:37:32 +03:00 
			
		
		
		
	[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
		
							parent
							
								
									d090efbd96
								
							
						
					
					
						commit
						75cce9018e
					
				| 
						 | 
					@ -270,16 +270,16 @@ class CommandLineInterface:
 | 
				
			||||||
            websocket_connect_timeout=args.websocket_connect_timeout,
 | 
					            websocket_connect_timeout=args.websocket_connect_timeout,
 | 
				
			||||||
            websocket_handshake_timeout=args.websocket_connect_timeout,
 | 
					            websocket_handshake_timeout=args.websocket_connect_timeout,
 | 
				
			||||||
            application_close_timeout=args.application_close_timeout,
 | 
					            application_close_timeout=args.application_close_timeout,
 | 
				
			||||||
            action_logger=AccessLogGenerator(access_log_stream)
 | 
					            action_logger=(
 | 
				
			||||||
            if access_log_stream
 | 
					                AccessLogGenerator(access_log_stream) if access_log_stream else None
 | 
				
			||||||
            else None,
 | 
					            ),
 | 
				
			||||||
            root_path=args.root_path,
 | 
					            root_path=args.root_path,
 | 
				
			||||||
            verbosity=args.verbosity,
 | 
					            verbosity=args.verbosity,
 | 
				
			||||||
            proxy_forwarded_address_header=self._get_forwarded_host(args=args),
 | 
					            proxy_forwarded_address_header=self._get_forwarded_host(args=args),
 | 
				
			||||||
            proxy_forwarded_port_header=self._get_forwarded_port(args=args),
 | 
					            proxy_forwarded_port_header=self._get_forwarded_port(args=args),
 | 
				
			||||||
            proxy_forwarded_proto_header="X-Forwarded-Proto"
 | 
					            proxy_forwarded_proto_header=(
 | 
				
			||||||
            if args.proxy_headers
 | 
					                "X-Forwarded-Proto" if args.proxy_headers else None
 | 
				
			||||||
            else None,
 | 
					            ),
 | 
				
			||||||
            server_name=args.server_name,
 | 
					            server_name=args.server_name,
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        self.server.run()
 | 
					        self.server.run()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -286,9 +286,11 @@ class WebRequest(http.Request):
 | 
				
			||||||
                            "path": uri,
 | 
					                            "path": uri,
 | 
				
			||||||
                            "status": self.code,
 | 
					                            "status": self.code,
 | 
				
			||||||
                            "method": self.method.decode("ascii", "replace"),
 | 
					                            "method": self.method.decode("ascii", "replace"),
 | 
				
			||||||
                            "client": "%s:%s" % tuple(self.client_addr)
 | 
					                            "client": (
 | 
				
			||||||
                            if self.client_addr
 | 
					                                "%s:%s" % tuple(self.client_addr)
 | 
				
			||||||
                            else None,
 | 
					                                if self.client_addr
 | 
				
			||||||
 | 
					                                else None
 | 
				
			||||||
 | 
					                            ),
 | 
				
			||||||
                            "time_taken": self.duration(),
 | 
					                            "time_taken": self.duration(),
 | 
				
			||||||
                            "size": self.sentLength,
 | 
					                            "size": self.sentLength,
 | 
				
			||||||
                        },
 | 
					                        },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -115,9 +115,9 @@ class WebSocketProtocol(WebSocketServerProtocol):
 | 
				
			||||||
            "connecting",
 | 
					            "connecting",
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                "path": self.request.path,
 | 
					                "path": self.request.path,
 | 
				
			||||||
                "client": "%s:%s" % tuple(self.client_addr)
 | 
					                "client": (
 | 
				
			||||||
                if self.client_addr
 | 
					                    "%s:%s" % tuple(self.client_addr) if self.client_addr else None
 | 
				
			||||||
                else None,
 | 
					                ),
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -138,9 +138,9 @@ class WebSocketProtocol(WebSocketServerProtocol):
 | 
				
			||||||
            "connected",
 | 
					            "connected",
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                "path": self.request.path,
 | 
					                "path": self.request.path,
 | 
				
			||||||
                "client": "%s:%s" % tuple(self.client_addr)
 | 
					                "client": (
 | 
				
			||||||
                if self.client_addr
 | 
					                    "%s:%s" % tuple(self.client_addr) if self.client_addr else None
 | 
				
			||||||
                else None,
 | 
					                ),
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -175,9 +175,9 @@ class WebSocketProtocol(WebSocketServerProtocol):
 | 
				
			||||||
            "disconnected",
 | 
					            "disconnected",
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                "path": self.request.path,
 | 
					                "path": self.request.path,
 | 
				
			||||||
                "client": "%s:%s" % tuple(self.client_addr)
 | 
					                "client": (
 | 
				
			||||||
                if self.client_addr
 | 
					                    "%s:%s" % tuple(self.client_addr) if self.client_addr else None
 | 
				
			||||||
                else None,
 | 
					                ),
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -242,9 +242,9 @@ class WebSocketProtocol(WebSocketServerProtocol):
 | 
				
			||||||
            "rejected",
 | 
					            "rejected",
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                "path": self.request.path,
 | 
					                "path": self.request.path,
 | 
				
			||||||
                "client": "%s:%s" % tuple(self.client_addr)
 | 
					                "client": (
 | 
				
			||||||
                if self.client_addr
 | 
					                    "%s:%s" % tuple(self.client_addr) if self.client_addr else None
 | 
				
			||||||
                else None,
 | 
					                ),
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user