mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
_header_x now defaults to empty string
Prior to this a request to e.g. https://latest.datasette.io/fixtures/magic_parameters which did not include a User-Agent header would trigger a 500 error.
This commit is contained in:
parent
2115d7e345
commit
9ac6292614
2 changed files with 2 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ import time
|
|||
def header(key, request):
|
||||
key = key.replace("_", "-").encode("utf-8")
|
||||
headers_dict = dict(request.scope["headers"])
|
||||
return headers_dict[key].decode("utf-8")
|
||||
return headers_dict.get(key, b"").decode("utf-8")
|
||||
|
||||
|
||||
def actor(key, request):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue