mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
keep_blank_values=True when parsing query_string, closes #1551
Refs #1518
This commit is contained in:
parent
492f9835aa
commit
a6ff123de5
3 changed files with 20 additions and 9 deletions
|
|
@ -121,3 +121,19 @@ def test_request_properties(path, query_string, expected_full_path):
|
|||
assert request.path == path
|
||||
assert request.query_string == query_string
|
||||
assert request.full_path == expected_full_path
|
||||
|
||||
|
||||
def test_request_blank_values():
|
||||
query_string = "a=b&foo=bar&foo=bar2&baz="
|
||||
path_with_query_string = "/?" + query_string
|
||||
scope = {
|
||||
"http_version": "1.1",
|
||||
"method": "POST",
|
||||
"path": "/",
|
||||
"raw_path": path_with_query_string.encode("latin-1"),
|
||||
"query_string": query_string.encode("latin-1"),
|
||||
"scheme": "http",
|
||||
"type": "http",
|
||||
}
|
||||
request = Request(scope, None)
|
||||
assert request.args._data == {"a": ["b"], "foo": ["bar", "bar2"], "baz": [""]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue