MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / javaScriptHttpErrorEndpoint

Function javaScriptHttpErrorEndpoint

rest/config_test.go:1663–1671  ·  view source on GitHub ↗

javaScriptHttpErrorEndpoint returns a callable function to setup an HTTP endpoint that always return StatusInternalServerError and a teardown function to terminate the underlying httptest server instance.

()

Source from the content-addressed store, hash-verified

1661// return StatusInternalServerError and a teardown function to terminate the underlying httptest
1662// server instance.
1663func javaScriptHttpErrorEndpoint() func() (path string, teardownFn func()) {
1664 return func() (path string, teardownFn func()) {
1665 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1666 w.WriteHeader(http.StatusInternalServerError)
1667 }))
1668 teardownFn = func() { ts.Close() }
1669 return ts.URL, teardownFn
1670 }
1671}
1672
1673// javaScriptHttpsEndpoint returns a callable function to setup an HTTPS endpoint that exposes
1674// the given JavaScript source and returns a teardown function to terminate the underlying

Calls 2

CloseMethod · 0.65
WriteHeaderMethod · 0.45

Tested by

no test coverage detected