Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileServerWithHeader ¶
func NewFileServerWithHeader(t *testing.T, filename string, headers map[string]string) (*httptest.Server, func())
NewFileServerWithHeader creates a test HTTP server that serves a single file with custom headers. It returns the server and a cleanup function that should be deferred.
Example usage:
headers := map[string]string{"Content-Type": "application/json"}
server, cleanup := NewFileServerWithHeader(t, "testdata/example.json", headers)
defer cleanup()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.