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

Function simpleSignPost

simplesign_binding_test.go:57–63  ·  view source on GitHub ↗

simpleSignPost returns a parsed POST request to target carrying v.

(t *testing.T, target string, v url.Values)

Source from the content-addressed store, hash-verified

55
56// simpleSignPost returns a parsed POST request to target carrying v.
57func simpleSignPost(t *testing.T, target string, v url.Values) *http.Request {
58 t.Helper()
59 req := httptest.NewRequest(http.MethodPost, target, strings.NewReader(v.Encode()))
60 req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
61 assert.NilError(t, req.ParseForm())
62 return req
63}
64
65var (
66 formInputRe = regexp.MustCompile(`<input type="hidden" name="([^"]+)" value="([^"]*)"`)

Calls 1

EncodeMethod · 0.65

Tested by

no test coverage detected