datasette --get --headers option, closes #2578

This commit is contained in:
Simon Willison 2025-11-04 18:12:15 -08:00
commit ce464da34b
3 changed files with 23 additions and 1 deletions

View file

@ -52,6 +52,27 @@ def test_serve_with_get(tmp_path_factory):
pm.unregister(to_unregister)
def test_serve_with_get_headers():
runner = CliRunner()
result = runner.invoke(
cli,
[
"serve",
"--memory",
"--get",
"/_memory/",
"--headers",
],
)
# exit_code is 1 because it wasn't a 200 response
assert result.exit_code == 1, result.output
assert result.output == (
"HTTP/1.1 302\n"
"location: /_memory\n"
"content-type: text/html; charset=utf-8\n"
)
def test_serve_with_get_and_token():
runner = CliRunner()
result1 = runner.invoke(