(t *testing.T)
| 762 | } |
| 763 | |
| 764 | func TestCustomFrameValueWithDenyForRequestOnly(t *testing.T) { |
| 765 | s := New(Options{ |
| 766 | FrameDeny: true, |
| 767 | CustomFrameOptionsValue: "SAMEORIGIN", |
| 768 | }) |
| 769 | |
| 770 | res := httptest.NewRecorder() |
| 771 | req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "/foo", nil) |
| 772 | |
| 773 | s.HandlerForRequestOnly(myHandler).ServeHTTP(res, req) |
| 774 | |
| 775 | expect(t, res.Code, http.StatusOK) |
| 776 | expect(t, res.Header().Get("X-Frame-Options"), "") |
| 777 | } |
| 778 | |
| 779 | func TestContentNosniff(t *testing.T) { |
| 780 | s := New(Options{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…