fix(handler): preserve origin on form submissions

Use the same-origin referrer policy to prevent Chrome from sending a null Origin header on POST requests.
This commit is contained in:
cole-maxwell1
2026-08-07 15:30:49 -05:00
parent b8f655ac58
commit 94d18ff8e2
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -56,6 +56,9 @@ func TestListRendersEscapedTodos(t *testing.T) {
if strings.Contains(recorder.Body.String(), "<script>") || !strings.Contains(recorder.Body.String(), "&lt;script&gt;") {
t.Fatalf("title was not escaped: %s", recorder.Body.String())
}
if got := recorder.Header().Get("Referrer-Policy"); got != "same-origin" {
t.Fatalf("Referrer-Policy = %q, want %q", got, "same-origin")
}
}
func TestCreateValidatesAndTrimsTitle(t *testing.T) {