MCPcopy Create free account
hub / github.com/crewjam/saml / plainHTTPServer

Function plainHTTPServer

service_provider_soap_https_test.go:15–24  ·  view source on GitHub ↗

plainHTTPServer serves handler over plain http, and counts the requests it gets.

(t *testing.T, handler http.Handler)

Source from the content-addressed store, hash-verified

13// plainHTTPServer serves handler over plain http, and counts the requests it
14// gets.
15func plainHTTPServer(t *testing.T, handler http.Handler) (*httptest.Server, *int) {
16 t.Helper()
17 var hits int
18 srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
19 hits++
20 handler.ServeHTTP(w, r)
21 }))
22 t.Cleanup(srv.Close)
23 return srv, &hits
24}
25
26// The service provider sends SOAP LogoutRequests only to an https
27// SingleLogoutService, unless AllowInsecureSOAPEndpoints is set.

Calls 1

ServeHTTPMethod · 0.80

Tested by

no test coverage detected