mirror of
https://github.com/cole-maxwell1/todo-hetzner.git
synced 2026-10-27 19:02:49 -05:00
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:
@@ -56,6 +56,9 @@ func TestListRendersEscapedTodos(t *testing.T) {
|
||||
if strings.Contains(recorder.Body.String(), "<script>") || !strings.Contains(recorder.Body.String(), "<script>") {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user