kopia lustrzana https://github.com/simonw/datasette
Handle scope path if it is a string
I ran into this while running a unit test with httpx.AsyncClientpull/652/head^2
rodzic
4933035b75
commit
dc80e779a2
|
@ -48,7 +48,11 @@ class Request:
|
||||||
if "raw_path" in self.scope:
|
if "raw_path" in self.scope:
|
||||||
return self.scope["raw_path"].decode("latin-1")
|
return self.scope["raw_path"].decode("latin-1")
|
||||||
else:
|
else:
|
||||||
return self.scope["path"].decode("utf-8")
|
path = self.scope["path"]
|
||||||
|
if isinstance(path, str):
|
||||||
|
return path
|
||||||
|
else:
|
||||||
|
return path.decode("utf-8")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def query_string(self):
|
def query_string(self):
|
||||||
|
|
Ładowanie…
Reference in New Issue