MCPcopy Index your code
hub / github.com/devploit/nomore403 / TestUnicodeEncodingSendsEncodedPaths

Function TestUnicodeEncodingSendsEncodedPaths

cmd/bypass_test.go:857–885  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

855}
856
857func TestUnicodeEncodingSendsEncodedPaths(t *testing.T) {
858 resetTestState()
859
860 ts, getRequests := testServer(t, nil)
861 defer ts.Close()
862
863 opts := RequestOptions{
864 uri: ts.URL + "/admin",
865 headers: []header{{"User-Agent", "test"}},
866 method: "GET",
867 proxy: &url.URL{},
868 timeout: 5000,
869 rateLimit: false,
870 redirect: false,
871 verbose: true,
872 }
873
874 requestUnicodeEncoding(opts)
875
876 reqs := getRequests()
877 if len(reqs) == 0 {
878 t.Fatal("expected unicode encoding requests to be sent, got 0")
879 }
880
881 // Should have multiple requests: overlong slash replacements + per-char encoding
882 if len(reqs) < 5 {
883 t.Errorf("expected at least 5 unicode encoding requests, got %d", len(reqs))
884 }
885}
886
887func TestVerbTamperingPreservesQueryString(t *testing.T) {
888 resetTestState()

Callers

nothing calls this directly

Calls 3

resetTestStateFunction · 0.85
testServerFunction · 0.85
requestUnicodeEncodingFunction · 0.85

Tested by

no test coverage detected