MCPcopy
hub / github.com/OJ/gobuster / httpServerT

Function httpServerT

libgobuster/http_test.go:24–32  ·  view source on GitHub ↗
(t *testing.T, content string)

Source from the content-addressed store, hash-verified

22}
23
24func httpServerT(t *testing.T, content string) *httptest.Server {
25 t.Helper()
26 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
27 if _, err := fmt.Fprint(w, content); err != nil {
28 t.Fatalf("%v", err)
29 }
30 }))
31 return ts
32}
33
34func randomString(length int) (string, error) {
35 letter := []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")

Callers 1

TestRequestFunction · 0.85

Calls 1

FatalfMethod · 0.80

Tested by

no test coverage detected