(t *testing.T)
| 655 | } |
| 656 | |
| 657 | func TestStsHeaderWithPreloadForRequest(t *testing.T) { |
| 658 | s := New(Options{ |
| 659 | STSSeconds: 315360000, |
| 660 | STSPreload: true, |
| 661 | }) |
| 662 | |
| 663 | res := httptest.NewRecorder() |
| 664 | req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, "/foo", nil) |
| 665 | req.URL.Scheme = httpsSchema |
| 666 | |
| 667 | s.HandlerForRequestOnly(myHandler).ServeHTTP(res, req) |
| 668 | |
| 669 | expect(t, res.Code, http.StatusOK) |
| 670 | expect(t, res.Header().Get("Strict-Transport-Security"), "") |
| 671 | } |
| 672 | |
| 673 | func TestStsHeaderWithSubdomainsWithPreload(t *testing.T) { |
| 674 | s := New(Options{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…