go/src/net/http/fs_test.go

const testFile

const testFileLen

type wantRange

var ServeFileRangeTests

func TestServeFile(t *testing.T) {}

func testServeFile(t *testing.T, mode testMode) {}

func TestServeFile_DotDot(t *testing.T) {}

// Tests that this doesn't panic. (Issue 30165)
func TestServeFileDirPanicEmptyPath(t *testing.T) {}

// Tests that ranges are ignored with serving empty content. (Issue 54794)
func TestServeContentWithEmptyContentIgnoreRanges(t *testing.T) {}

var fsRedirectTestData

func TestFSRedirect(t *testing.T) {}

func testFSRedirect(t *testing.T, mode testMode) {}

type testFileSystem

func (fs *testFileSystem) Open(name string) (File, error) {}

func TestFileServerCleans(t *testing.T) {}

func TestFileServerEscapesNames(t *testing.T) {}

func testFileServerEscapesNames(t *testing.T, mode testMode) {}

func TestFileServerSortsNames(t *testing.T) {}

func testFileServerSortsNames(t *testing.T, mode testMode) {}

func mustRemoveAll(dir string) {}

func TestFileServerImplicitLeadingSlash(t *testing.T) {}

func testFileServerImplicitLeadingSlash(t *testing.T, mode testMode) {}

func TestDirJoin(t *testing.T) {}

func TestEmptyDirOpenCWD(t *testing.T) {}

func TestServeFileContentType(t *testing.T) {}

func testServeFileContentType(t *testing.T, mode testMode) {}

func TestServeFileMimeType(t *testing.T) {}

func testServeFileMimeType(t *testing.T, mode testMode) {}

func TestServeFileFromCWD(t *testing.T) {}

func testServeFileFromCWD(t *testing.T, mode testMode) {}

// Issue 13996
func TestServeDirWithoutTrailingSlash(t *testing.T) {}

func testServeDirWithoutTrailingSlash(t *testing.T, mode testMode) {}

// Tests that ServeFile doesn't add a Content-Length if a Content-Encoding is
// specified.
func TestServeFileWithContentEncoding(t *testing.T) {}

func testServeFileWithContentEncoding(t *testing.T, mode testMode) {}

// Tests that ServeFile does not generate representation metadata when
// file has not been modified, as per RFC 7232 section 4.1.
func TestServeFileNotModified(t *testing.T) {}

func testServeFileNotModified(t *testing.T, mode testMode) {}

func TestServeIndexHtml(t *testing.T) {}

func testServeIndexHtml(t *testing.T, mode testMode) {}

func TestServeIndexHtmlFS(t *testing.T) {}

func testServeIndexHtmlFS(t *testing.T, mode testMode) {}

func TestFileServerZeroByte(t *testing.T) {}

func testFileServerZeroByte(t *testing.T, mode testMode) {}

func TestFileServerNamesEscape(t *testing.T) {}

func testFileServerNamesEscape(t *testing.T, mode testMode) {}

type fakeFileInfo

func (f *fakeFileInfo) Name() string       {}

func (f *fakeFileInfo) Sys() any           {}

func (f *fakeFileInfo) ModTime() time.Time {}

func (f *fakeFileInfo) IsDir() bool        {}

func (f *fakeFileInfo) Size() int64        {}

func (f *fakeFileInfo) Mode() fs.FileMode {}

func (f *fakeFileInfo) String() string {}

type fakeFile

func (f *fakeFile) Close() error               {}

func (f *fakeFile) Stat() (fs.FileInfo, error) {}

func (f *fakeFile) Readdir(count int) ([]fs.FileInfo, error) {}

type fakeFS

func (fsys fakeFS) Open(name string) (File, error) {}

func TestDirectoryIfNotModified(t *testing.T) {}

func testDirectoryIfNotModified(t *testing.T, mode testMode) {}

func mustStat(t *testing.T, fileName string) fs.FileInfo {}

func TestServeContent(t *testing.T) {}

func testServeContent(t *testing.T, mode testMode) {}

// Issue 12991
func TestServerFileStatError(t *testing.T) {}

type issue12991FS

func (issue12991FS) Open(string) (File, error) {}

type issue12991File

func (issue12991File) Stat() (fs.FileInfo, error) {}

func (issue12991File) Close() error               {}

func TestFileServerErrorMessages(t *testing.T) {}

func testFileServerErrorMessages(t *testing.T, mode testMode, keepHeaders bool) {}

// verifies that sendfile is being used on Linux
func TestLinuxSendfile(t *testing.T) {}

func getBody(t *testing.T, testName string, req Request, client *Client) (*Response, []byte) {}

// TestLinuxSendfileChild isn't a real test. It's used as a helper process
// for TestLinuxSendfile.
func TestLinuxSendfileChild(*testing.T) {}

// Issues 18984, 49552: tests that requests for paths beyond files return not-found errors
func TestFileServerNotDirError(t *testing.T) {}

func testFileServerNotDirError(t *testing.T, mode testMode, newfs func(string) FileSystem) {}

func TestFileServerCleanPath(t *testing.T) {}

type fileServerCleanPathDir

func (d fileServerCleanPathDir) Open(path string) (File, error) {}

type panicOnSeek

func TestScanETag(t *testing.T) {}

// Issue 40940: Ensure that we only accept non-negative suffix-lengths
// in "Range": "bytes=-N", and should reject "bytes=--2".
func TestServeFileRejectsInvalidSuffixLengths(t *testing.T) {}

func testServeFileRejectsInvalidSuffixLengths(t *testing.T, mode testMode) {}

func TestFileServerMethods(t *testing.T) {}

func testFileServerMethods(t *testing.T, mode testMode) {}

func TestFileServerFS(t *testing.T) {}

func TestServeFileFS(t *testing.T) {}

func TestServeFileZippingResponseWriter(t *testing.T) {}

type gzipResponseWriter

func (grw gzipResponseWriter) Write(b []byte) (int, error) {}

func (grw gzipResponseWriter) Flush() {}

// Issue 63769
func TestFileServerDirWithRootFile(t *testing.T) {}

func testFileServerDirWithRootFile(t *testing.T, mode testMode) {}

func TestServeContentHeadersWithError(t *testing.T) {}

func testServeContentHeadersWithError(t *testing.T, keepHeaders bool) {}