Skip to content

Commit

Permalink
http.NoBody
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Oct 19, 2022
1 parent b2bcb4d commit 468c79f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions static_test.go
Expand Up @@ -25,7 +25,7 @@ func TestStatic(t *testing.T) {

t.Run("serve with GET", func(t *testing.T) {
resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodGet, "/.editorconfig", nil)
req, err := http.NewRequest(http.MethodGet, "/.editorconfig", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand All @@ -37,7 +37,7 @@ func TestStatic(t *testing.T) {

t.Run("serve with HEAD", func(t *testing.T) {
resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodHead, "/.editorconfig", nil)
req, err := http.NewRequest(http.MethodHead, "/.editorconfig", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand All @@ -49,7 +49,7 @@ func TestStatic(t *testing.T) {

t.Run("404 with POST", func(t *testing.T) {
resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodPost, "/.editorconfig", nil)
req, err := http.NewRequest(http.MethodPost, "/.editorconfig", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand All @@ -73,7 +73,7 @@ func TestStatic_Options(t *testing.T) {
))

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodGet, "/hello.txt", nil)
req, err := http.NewRequest(http.MethodGet, "/hello.txt", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestStatic_Options(t *testing.T) {
))

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodHead, "/", nil)
req, err := http.NewRequest(http.MethodHead, "/", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand All @@ -164,7 +164,7 @@ func TestStatic_Options(t *testing.T) {
))

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodHead, "/.editorconfig", nil)
req, err := http.NewRequest(http.MethodHead, "/.editorconfig", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestStatic_Options(t *testing.T) {
))

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodGet, "/.editorconfig", nil)
req, err := http.NewRequest(http.MethodGet, "/.editorconfig", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand All @@ -229,7 +229,7 @@ func TestStatic_Options(t *testing.T) {
))

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodGet, "/.editorconfig", nil)
req, err := http.NewRequest(http.MethodGet, "/.editorconfig", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestStatic_Redirect(t *testing.T) {
))

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodGet, "/public/", nil)
req, err := http.NewRequest(http.MethodGet, "/public/", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand All @@ -278,7 +278,7 @@ func TestStatic_Redirect(t *testing.T) {
))

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodGet, "/public", nil)
req, err := http.NewRequest(http.MethodGet, "/public", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand All @@ -292,7 +292,7 @@ func TestStatic_Redirect(t *testing.T) {
f.Use(Static())

resp := httptest.NewRecorder()
req, err := http.NewRequest(http.MethodGet, "http://localhost:2830//example.com%2f..", nil)
req, err := http.NewRequest(http.MethodGet, "http://localhost:2830//example.com%2f..", http.NoBody)
assert.Nil(t, err)

f.ServeHTTP(resp, req)
Expand Down

0 comments on commit 468c79f

Please sign in to comment.