Skip to content

Commit 04b5019

Browse files
committed
net/http: removes wrong test case
1 parent ed93ac5 commit 04b5019

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/net/http/fs_test.go

-25
Original file line numberDiff line numberDiff line change
@@ -234,31 +234,6 @@ func TestServeFile_DotDot(t *testing.T) {
234234
}
235235
}
236236

237-
func TestServeFile_InvalidUnsafePath(t *testing.T) {
238-
tests := []struct {
239-
req string
240-
wantStatus int
241-
}{
242-
{"/testdata/file", 200},
243-
{"/%00/file", 404},
244-
{"/file%00", 404},
245-
{"/%00", 404},
246-
}
247-
for _, tt := range tests {
248-
req, err := ReadRequest(bufio.NewReader(strings.NewReader("GET " + tt.req + " HTTP/1.1\r\nHost: foo\r\n\r\n")))
249-
if err != nil {
250-
t.Errorf("bad request %q: %v", tt.req, err)
251-
continue
252-
}
253-
rec := httptest.NewRecorder()
254-
ServeFile(rec, req, "testdata/file")
255-
if rec.Code != tt.wantStatus {
256-
t.Logf("%v", rec.Result())
257-
t.Errorf("for request %q, status = %d; want %d", tt.req, rec.Code, tt.wantStatus)
258-
}
259-
}
260-
}
261-
262237
// Tests that this doesn't panic. (Issue 30165)
263238
func TestServeFileDirPanicEmptyPath(t *testing.T) {
264239
rec := httptest.NewRecorder()

0 commit comments

Comments
 (0)