mirror of
				https://github.com/django/daphne.git
				synced 2025-11-04 01:27:33 +03:00 
			
		
		
		
	Switch to uncode path and query string for HTTP
This commit is contained in:
		
							parent
							
								
									7945859bb2
								
							
						
					
					
						commit
						e684b27e46
					
				| 
						 | 
					@ -41,8 +41,8 @@ class AsgiRequest(http.HttpRequest):
 | 
				
			||||||
        self._post_parse_error = False
 | 
					        self._post_parse_error = False
 | 
				
			||||||
        self.resolver_match = None
 | 
					        self.resolver_match = None
 | 
				
			||||||
        # Path info
 | 
					        # Path info
 | 
				
			||||||
        self.path = self.message['path'].decode("ascii")
 | 
					        self.path = self.message['path']
 | 
				
			||||||
        self.script_name = self.message.get('root_path', b'')
 | 
					        self.script_name = self.message.get('root_path', '')
 | 
				
			||||||
        if self.script_name:
 | 
					        if self.script_name:
 | 
				
			||||||
            # TODO: Better is-prefix checking, slash handling?
 | 
					            # TODO: Better is-prefix checking, slash handling?
 | 
				
			||||||
            self.path_info = self.path[len(self.script_name):]
 | 
					            self.path_info = self.path[len(self.script_name):]
 | 
				
			||||||
| 
						 | 
					@ -52,8 +52,8 @@ class AsgiRequest(http.HttpRequest):
 | 
				
			||||||
        self.method = self.message['method'].upper()
 | 
					        self.method = self.message['method'].upper()
 | 
				
			||||||
        self.META = {
 | 
					        self.META = {
 | 
				
			||||||
            "REQUEST_METHOD": self.method,
 | 
					            "REQUEST_METHOD": self.method,
 | 
				
			||||||
            "QUERY_STRING": self.message.get('query_string', b'').decode("ascii"),
 | 
					            "QUERY_STRING": self.message.get('query_string', ''),
 | 
				
			||||||
            "SCRIPT_NAME": self.script_name.decode("ascii"),
 | 
					            "SCRIPT_NAME": self.script_name,
 | 
				
			||||||
            # Old code will need these for a while
 | 
					            # Old code will need these for a while
 | 
				
			||||||
            "wsgi.multithread": True,
 | 
					            "wsgi.multithread": True,
 | 
				
			||||||
            "wsgi.multiprocess": True,
 | 
					            "wsgi.multiprocess": True,
 | 
				
			||||||
| 
						 | 
					@ -133,10 +133,7 @@ class AsgiRequest(http.HttpRequest):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @cached_property
 | 
					    @cached_property
 | 
				
			||||||
    def GET(self):
 | 
					    def GET(self):
 | 
				
			||||||
        return http.QueryDict(
 | 
					        return http.QueryDict(self.message.get('query_string', '').encode("utf8"))
 | 
				
			||||||
            self.message.get('query_string', ''),
 | 
					 | 
				
			||||||
            encoding=self._encoding,
 | 
					 | 
				
			||||||
        )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _get_post(self):
 | 
					    def _get_post(self):
 | 
				
			||||||
        if not hasattr(self, '_post'):
 | 
					        if not hasattr(self, '_post'):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user