File tree 3 files changed +19
-3
lines changed 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 97
97
'HttpMethod'
98
98
)
99
99
100
- __version__ = '1.19.0b3 '
100
+ __version__ = '1.19.0 '
Original file line number Diff line number Diff line change @@ -29,8 +29,11 @@ def __init__(self,
29
29
# Implement interfaces for PEP 3333 environ
30
30
self .request_method = getattr (func_req , 'method' , None )
31
31
self .script_name = ''
32
- self .path_info = unquote_to_bytes (
33
- getattr (url , 'path' , None )).decode ('latin-1' ) # type: ignore
32
+ self .path_info = (
33
+ unquote_to_bytes (getattr (url , 'path' , None )) # type: ignore
34
+ .decode ('latin-1' if type (self ) is WsgiRequest else 'utf-8' )
35
+ )
36
+
34
37
self .query_string = getattr (url , 'query' , None )
35
38
self .content_type = self ._lowercased_headers .get ('content-type' )
36
39
self .content_length = str (len (func_req_body ))
Original file line number Diff line number Diff line change 14
14
WsgiResponse ,
15
15
WsgiMiddleware
16
16
)
17
+ from azure .functions ._http_asgi import AsgiRequest
17
18
18
19
19
20
class WsgiException (Exception ):
@@ -211,6 +212,18 @@ def test_middleware_wrapper(self):
211
212
self .assertEqual (func_response .status_code , 200 )
212
213
self .assertEqual (func_response .get_body (), b'sample string' )
213
214
215
+ def test_path_encoding_utf8 (self ):
216
+ url = 'http://example.com/Pippi%20L%C3%A5ngstrump'
217
+ request = AsgiRequest (self ._generate_func_request (url = url ))
218
+
219
+ self .assertEqual (request .path_info , u'/Pippi L\u00e5 ngstrump' )
220
+
221
+ def test_path_encoding_latin1 (self ):
222
+ url = 'http://example.com/Pippi%20L%C3%A5ngstrump'
223
+ request = WsgiRequest (self ._generate_func_request (url = url ))
224
+
225
+ self .assertEqual (request .path_info , u'/Pippi L\u00c3 \u00a5 ngstrump' )
226
+
214
227
def _generate_func_request (
215
228
self ,
216
229
method = "POST" ,
You can’t perform that action at this time.
0 commit comments