(t *testing.T)
| 879 | } |
| 880 | |
| 881 | func TestBothXSSProtectionForRequestOnly(t *testing.T) { |
| 882 | xssVal := "0" |
| 883 | s := New(Options{ |
| 884 | BrowserXssFilter: true, |
| 885 | CustomBrowserXssValue: xssVal, |
| 886 | }) |
| 887 | |
| 888 | res := httptest.NewRecorder() |
| 889 | req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "/foo", nil) |
| 890 | |
| 891 | s.HandlerForRequestOnly(myHandler).ServeHTTP(res, req) |
| 892 | |
| 893 | expect(t, res.Code, http.StatusOK) |
| 894 | expect(t, res.Header().Get("X-XSS-Protection"), "") |
| 895 | } |
| 896 | |
| 897 | func TestCsp(t *testing.T) { |
| 898 | s := New(Options{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…