blob: 7e96c5e28741877105c65afe33b01d95642b55c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package acceptance_test
import (
"net/http"
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers"
)
func TestUnknownHTTPMethod(t *testing.T) {
RunPagesProcess(t,
withListeners([]ListenSpec{httpListener}),
)
req, err := http.NewRequest("UNKNOWN", httpListener.URL(""), nil)
require.NoError(t, err)
req.Host = ""
resp, err := DoPagesRequest(t, httpListener, req)
require.NoError(t, err)
testhelpers.Close(t, resp.Body)
require.Equal(t, http.StatusMethodNotAllowed, resp.StatusCode)
}
|