(t *testing.T)
| 855 | } |
| 856 | |
| 857 | func 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 | |
| 887 | func TestVerbTamperingPreservesQueryString(t *testing.T) { |
| 888 | resetTestState() |
nothing calls this directly
no test coverage detected