MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / TestAjaxForbiddendRequest

Function TestAjaxForbiddendRequest

oauthproxy_test.go:1764–1776  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1762}
1763
1764func TestAjaxForbiddendRequest(t *testing.T) {
1765 test, err := newAjaxRequestTest(false)
1766 if err != nil {
1767 t.Fatal(err)
1768 }
1769 endpoint := "/test"
1770 header := make(http.Header)
1771 code, rh, _, err := test.getEndpoint(endpoint, header)
1772 assert.NoError(t, err)
1773 assert.Equal(t, http.StatusForbidden, code)
1774 mime := rh.Get("Content-Type")
1775 assert.NotEqual(t, applicationJSON, mime)
1776}
1777
1778func TestClearSplitCookie(t *testing.T) {
1779 opts := baseTestOptions()

Callers

nothing calls this directly

Calls 3

newAjaxRequestTestFunction · 0.85
getEndpointMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected