MCPcopy Index your code
hub / github.com/github/github-mcp-server / TestCallbackHandlerEscapesError

Function TestCallbackHandlerEscapesError

internal/oauth/callback_test.go:65–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestCallbackHandlerEscapesError(t *testing.T) {
66 rec, _ := serveCallback(t, "state123", "error=evil&error_description=%3Cscript%3Ealert(1)%3C%2Fscript%3E")
67
68 body := rec.Body.String()
69 assert.NotContains(t, body, "<script>", "error message must be HTML-escaped")
70 assert.Contains(t, body, "&lt;script&gt;")
71}
72
73func TestListenCallbackRandomPortIsLoopback(t *testing.T) {
74 listener, err := listenCallback(0, false)

Callers

nothing calls this directly

Calls 2

serveCallbackFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected