@@ -54,7 +54,7 @@ func TestRobotsTxt(t *testing.T) {
5454 t.Fatal(err)
5555 }
5656 rw := httptest.NewRecorder()
57− req, _ := http.NewRequest(http.MethodGet, "/robots.txt", nil)
57+ req, _ := http.NewRequest("GET", "/robots.txt", nil)
5858 proxy.ServeHTTP(rw, req)
5959 assert.Equal(t, 200, rw.Code)
6060 assert.Equal(t, "User-agent: *\nDisallow: /\n", rw.Body.String())
@@ -241,7 +241,7 @@ func TestBasicAuthPassword(t *testing.T) {
241241
242242 // Save the required session
243243 rw := httptest.NewRecorder()
244− req, _ := http.NewRequest(http.MethodGet, "/", nil)
244+ req, _ := http.NewRequest("GET", "/", nil)
245245 err = proxy.sessionStore.Save(rw, req, &sessions.SessionState{
246246 Email: emailAddress,
247247 })
@@ -250,7 +250,7 @@ func TestBasicAuthPassword(t *testing.T) {
250250 // Extract the cookie value to inject into the test request
251251 cookie := rw.Header().Values("Set-Cookie")[0]
252252
253− req, _ = http.NewRequest(http.MethodGet, "/", nil)
253+ req, _ = http.NewRequest("GET", "/", nil)
254254 req.Header.Set("Cookie", cookie)
255255 rw = httptest.NewRecorder()
256256 proxy.ServeHTTP(rw, req)
@@ -300,14 +300,14 @@ func TestPassGroupsHeadersWithGroups(t *testing.T) {
300300
301301 // Save the required session
302302 rw := httptest.NewRecorder()
303− req, _ := http.NewRequest(http.MethodGet, "/", nil)
303+ req, _ := http.NewRequest("GET", "/", nil)
304304 err = proxy.sessionStore.Save(rw, req, session)
305305 assert.NoError(t, err)
306306
307307 // Extract the cookie value to inject into the test request
308308 cookie := rw.Header().Values("Set-Cookie")[0]
309309
310− req, _ = http.NewRequest(http.MethodGet, "/", nil)
310+ req, _ = http.NewRequest("GET", "/", nil)
311311 req.Header.Set("Cookie", cookie)
312312 rw = httptest.NewRecorder()
313313 proxy.ServeHTTP(rw, req)
@@ -457,7 +457,7 @@ func (patTest *PassAccessTokenTest) getEndpointWithCookie(cookie string, endpoin
457457 return 0, ""
458458 }
459459
460− req, err := http.NewRequest(http.MethodGet, endpoint, strings.NewReader(""))
460+ req, err := http.NewRequest("GET", endpoint, strings.NewReader(""))
461461 if err != nil {
462462 return 0, ""
463463 }
@@ -608,7 +608,7 @@ func NewSignInPageTest(skipProvider bool) (*SignInPageTest, error) {
608608
609609func (sipTest *SignInPageTest) GetEndpoint(endpoint string) (int, string) {
610610 rw := httptest.NewRecorder()
611− req, _ := http.NewRequest(http.MethodGet, endpoint, strings.NewReader(""))
611+ req, _ := http.NewRequest("GET", endpoint, strings.NewReader(""))
612612 sipTest.proxy.ServeHTTP(rw, req)
613613 return rw.Code, rw.Body.String()
614614}
@@ -894,7 +894,7 @@ func NewProcessCookieTest(opts ProcessCookieTestOpts, modifiers ...OptionsModifi
894894 // access_token validation.
895895 pcTest.proxy.CookieOptions.Refresh = time.Duration(0)
896896 pcTest.rw = httptest.NewRecorder()
897− pcTest.req, _ = http.NewRequest(http.MethodGet, "/", strings.NewReader(""))
897+ pcTest.req, _ = http.NewRequest("GET", "/", strings.NewReader(""))
898898 pcTest.validateUser = true
899899 return &pcTest, nil
900900}
@@ -1027,7 +1027,7 @@ func NewUserInfoEndpointTest() (*ProcessCookieTest, error) {
10271027 if err != nil {
10281028 return nil, err
10291029 }
1030− pcTest.req, _ = http.NewRequest(http.MethodGet,
1030+ pcTest.req, _ = http.NewRequest("GET",
10311031 pcTest.opts.ProxyPrefix+"/userinfo", nil)
10321032 return pcTest, nil
10331033}
@@ -1135,7 +1135,7 @@ func NewAuthOnlyEndpointTest(querystring string, modifiers ...OptionsModifier) (
11351135 return nil, err
11361136 }
11371137 pcTest.req, _ = http.NewRequest(
1138− http.MethodGet,
1138+ "GET",
11391139 fmt.Sprintf("%s/auth%s", pcTest.opts.ProxyPrefix, querystring),
11401140 nil)
11411141 return pcTest, nil
@@ -1274,7 +1274,7 @@ func TestAuthOnlyEndpointSetXAuthRequestHeaders(t *testing.T) {
12741274 pcTest.validateUser = true
12751275
12761276 pcTest.rw = httptest.NewRecorder()
1277− pcTest.req, _ = http.NewRequest(http.MethodGet,
1277+ pcTest.req, _ = http.NewRequest("GET",
12781278 pcTest.opts.ProxyPrefix+authOnlyPath, nil)
12791279
12801280 created := time.Now()
@@ -1367,7 +1367,7 @@ func TestAuthOnlyEndpointSetBasicAuthTrueRequestHeaders(t *testing.T) {
13671367 pcTest.validateUser = true
13681368
13691369 pcTest.rw = httptest.NewRecorder()
1370− pcTest.req, _ = http.NewRequest(http.MethodGet,
1370+ pcTest.req, _ = http.NewRequest("GET",
13711371 pcTest.opts.ProxyPrefix+authOnlyPath, nil)
13721372
13731373 created := time.Now()
@@ -1447,7 +1447,7 @@ func TestAuthOnlyEndpointSetBasicAuthFalseRequestHeaders(t *testing.T) {
14471447 pcTest.validateUser = true
14481448
14491449 pcTest.rw = httptest.NewRecorder()
1450− pcTest.req, _ = http.NewRequest(http.MethodGet,
1450+ pcTest.req, _ = http.NewRequest("GET",
14511451 pcTest.opts.ProxyPrefix+authOnlyPath, nil)
14521452
14531453 created := time.Now()
@@ -1495,7 +1495,7 @@ func TestAuthSkippedForPreflightRequests(t *testing.T) {
14951495 }
14961496 proxy.provider = NewTestProvider(upstreamURL, "")
14971497 rw := httptest.NewRecorder()
1498− req, _ := http.NewRequest(http.MethodOptions, "/preflight-request", nil)
1498+ req, _ := http.NewRequest("OPTIONS", "/preflight-request", nil)
14991499 proxy.ServeHTTP(rw, req)
15001500
15011501 assert.Equal(t, 200, rw.Code)
@@ -1652,19 +1652,19 @@ func TestRequestSignature(t *testing.T) {
16521652 resp string
16531653 }{
16541654 "No request signature": {
1655− method: http.MethodGet,
1655+ method: "GET",
16561656 body: "",
16571657 key: "",
16581658 resp: "no signature received",
16591659 },
16601660 "Get request": {
1661− method: http.MethodGet,
1661+ method: "GET",
16621662 body: "",
16631663 key: "7d9e1aa87a5954e6f9fc59266b3af9d7c35fda2d",
16641664 resp: "signatures match",
16651665 },
16661666 "Post request": {
1667− method: http.MethodPost,
1667+ method: "POST",
16681668 body: `{ "hello": "world!" }`,
16691669 key: "d90df39e2d19282840252612dd7c81421a372f61",
16701670 resp: "signatures match",
@@ -2189,7 +2189,7 @@ func TestTrustedIPs(t *testing.T) {
21892189 reverseProxy: false,
21902190 realClientIPHeader: "X-Real-IP", // Default value
21912191 req: func() *http.Request {
2192− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2192+ req, _ := http.NewRequest("GET", "/", nil)
21932193 return req
21942194 }(),
21952195 expectTrusted: false,
@@ -2201,7 +2201,7 @@ func TestTrustedIPs(t *testing.T) {
22012201 reverseProxy: false,
22022202 realClientIPHeader: "X-Real-IP",
22032203 req: func() *http.Request {
2204− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2204+ req, _ := http.NewRequest("GET", "/", nil)
22052205 req.RemoteAddr = "@"
22062206 return req
22072207 }(),
@@ -2214,7 +2214,7 @@ func TestTrustedIPs(t *testing.T) {
22142214 reverseProxy: false,
22152215 realClientIPHeader: "X-Real-IP",
22162216 req: func() *http.Request {
2217− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2217+ req, _ := http.NewRequest("GET", "/", nil)
22182218 req.RemoteAddr = "@"
22192219 return req
22202220 }(),
@@ -2227,7 +2227,7 @@ func TestTrustedIPs(t *testing.T) {
22272227 reverseProxy: false,
22282228 realClientIPHeader: "X-Real-IP", // Default value
22292229 req: func() *http.Request {
2230− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2230+ req, _ := http.NewRequest("GET", "/", nil)
22312231 req.RemoteAddr = "127.0.0.1:43670"
22322232 return req
22332233 }(),
@@ -2240,7 +2240,7 @@ func TestTrustedIPs(t *testing.T) {
22402240 reverseProxy: true,
22412241 realClientIPHeader: "X-Real-IP", // Default value
22422242 req: func() *http.Request {
2243− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2243+ req, _ := http.NewRequest("GET", "/", nil)
22442244 req.RemoteAddr = "127.0.0.1:44324"
22452245 return req
22462246 }(),
@@ -2253,7 +2253,7 @@ func TestTrustedIPs(t *testing.T) {
22532253 reverseProxy: true,
22542254 realClientIPHeader: "X-Forwarded-For",
22552255 req: func() *http.Request {
2256− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2256+ req, _ := http.NewRequest("GET", "/", nil)
22572257 req.Header.Add("X-Forwarded-For", "127.0.0.1")
22582258 return req
22592259 }(),
@@ -2266,7 +2266,7 @@ func TestTrustedIPs(t *testing.T) {
22662266 reverseProxy: true,
22672267 realClientIPHeader: "X-Forwarded-For",
22682268 req: func() *http.Request {
2269− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2269+ req, _ := http.NewRequest("GET", "/", nil)
22702270 req.Header.Add("X-Forwarded-For", "::1")
22712271 return req
22722272 }(),
@@ -2279,7 +2279,7 @@ func TestTrustedIPs(t *testing.T) {
22792279 reverseProxy: true,
22802280 realClientIPHeader: "X-Forwarded-For",
22812281 req: func() *http.Request {
2282− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2282+ req, _ := http.NewRequest("GET", "/", nil)
22832283 req.Header.Add("X-Forwarded-For", "12.34.56.78")
22842284 return req
22852285 }(),
@@ -2292,7 +2292,7 @@ func TestTrustedIPs(t *testing.T) {
22922292 reverseProxy: true,
22932293 realClientIPHeader: "X-Forwarded-For",
22942294 req: func() *http.Request {
2295− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2295+ req, _ := http.NewRequest("GET", "/", nil)
22962296 req.Header.Add("X-Forwarded-For", "::2")
22972297 return req
22982298 }(),
@@ -2305,7 +2305,7 @@ func TestTrustedIPs(t *testing.T) {
23052305 reverseProxy: true,
23062306 realClientIPHeader: "X-Forwarded-For",
23072307 req: func() *http.Request {
2308− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2308+ req, _ := http.NewRequest("GET", "/", nil)
23092309 req.Header.Add("X-Real-IP", "::1")
23102310 return req
23112311 }(),
@@ -2318,7 +2318,7 @@ func TestTrustedIPs(t *testing.T) {
23182318 reverseProxy: true,
23192319 realClientIPHeader: "X-Forwarded-For",
23202320 req: func() *http.Request {
2321− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2321+ req, _ := http.NewRequest("GET", "/", nil)
23222322 req.Header.Add("X-Forwarded-For", "adsfljk29242as!!")
23232323 return req
23242324 }(),
@@ -2331,7 +2331,7 @@ func TestTrustedIPs(t *testing.T) {
23312331 reverseProxy: false,
23322332 realClientIPHeader: "X-Real-IP",
23332333 req: func() *http.Request {
2334− req, _ := http.NewRequest(http.MethodGet, "/", nil)
2334+ req, _ := http.NewRequest("GET", "/", nil)
23352335 req.RemoteAddr = "adsfljk29242as!!"
23362336 return req
23372337 }(),
@@ -2427,12 +2427,12 @@ func Test_buildRoutesAllowlist(t *testing.T) {
24272427 },
24282428 expectedRoutes: []expectedAllowedRoute{
24292429 {
2430− method: http.MethodGet,
2430+ method: "GET",
24312431 negate: false,
24322432 regexString: "^/foo/bar",
24332433 },
24342434 {
2435− method: http.MethodPost,
2435+ method: "POST",
24362436 negate: false,
24372437 regexString: "^/baz/[0-9]+/thing",
24382438 },
@@ -2485,11 +2485,11 @@ func Test_buildRoutesAllowlist(t *testing.T) {
24852485 regexString: "^/baz/[0-9]+/thing/regex",
24862486 },
24872487 {
2488− method: http.MethodGet,
2488+ method: "GET",
24892489 regexString: "^/foo/bar",
24902490 },
24912491 {
2492− method: http.MethodPost,
2492+ method: "POST",
24932493 regexString: "^/baz/[0-9]+/thing",
24942494 },
24952495 {
@@ -2641,7 +2641,7 @@ func TestApiRoutes(t *testing.T) {
26412641
26422642 for _, tc := range testCases {
26432643 t.Run(tc.name, func(t *testing.T) {
2644− req, err := http.NewRequest(http.MethodGet, tc.url, nil)
2644+ req, err := http.NewRequest("GET", tc.url, nil)
26452645 req.Header.Set("Accept", tc.contentType)
26462646 assert.NoError(t, err)
26472647
@@ -2679,11 +2679,9 @@ func TestAllowedRequest(t *testing.T) {
26792679 }
26802680 opts.SkipAuthRegex = []string{
26812681 "^/skip/auth/regex$",
2682− "^/public/.*/endpoint$",
26832682 }
26842683 opts.SkipAuthRoutes = []string{
26852684 "GET=^/skip/auth/routes/get",
2686− "^/foo/.*/bar$",
26872685 }
26882686 err := validation.Validate(opts)
26892687 assert.NoError(t, err)
@@ -2700,37 +2698,25 @@ func TestAllowedRequest(t *testing.T) {
27002698 }{
27012699 {
27022700 name: "Regex GET allowed",
2703− method: http.MethodGet,
2701+ method: "GET",
27042702 url: "/skip/auth/regex",
27052703 allowed: true,
27062704 },
27072705 {
27082706 name: "Regex POST allowed ",
2709− method: http.MethodPost,
2707+ method: "POST",
27102708 url: "/skip/auth/regex",
27112709 allowed: true,
27122710 },
27132711 {
27142712 name: "Regex denied",
2715− method: http.MethodGet,
2713+ method: "GET",
27162714 url: "/wrong/denied",
27172715 allowed: false,
27182716 },
2719− {
2720− name: "Regex allowed with fragment-free path",
2721− method: http.MethodGet,
2722− url: "/public/legit/endpoint",
2723− allowed: true,
2724− },
2725− {
2726− name: "Regex denied when path contains encoded fragment suffix",
2727− method: http.MethodGet,
2728− url: "/public/secret%23/endpoint",
2729− allowed: false,
2730− },
27312717 {
27322718 name: "Route allowed",
2733− method: http.MethodGet,
2719+ method: "GET",
27342720 url: "/skip/auth/routes/get",
27352721 allowed: true,
27362722 },
@@ -2742,28 +2728,16 @@ func TestAllowedRequest(t *testing.T) {
27422728 },
27432729 {
27442730 name: "Route denied with wrong path",
2745− method: http.MethodGet,
2731+ method: "GET",
27462732 url: "/skip/auth/routes/wrong/path",
27472733 allowed: false,
27482734 },
27492735 {
27502736 name: "Route denied with wrong path and method",
2751− method: http.MethodPost,
2737+ method: "POST",
27522738 url: "/skip/auth/routes/wrong/path",
27532739 allowed: false,
27542740 },
2755− {
2756− name: "Route allowed with fragment-free path",
2757− method: http.MethodGet,
2758− url: "/foo/public/bar",
2759− allowed: true,
2760− },
2761− {
2762− name: "Route denied when path contains encoded fragment suffix",
2763− method: http.MethodGet,
2764− url: "/foo/secret%23/bar",
2765− allowed: false,
2766− },
27672741 }
27682742
27692743 for _, tc := range testCases {
@@ -2804,11 +2778,9 @@ func TestAllowedRequestWithForwardedUriHeader(t *testing.T) {
28042778 }
28052779 opts.SkipAuthRegex = []string{
28062780 "^/skip/auth/regex$",
2807− "^/public/.*/endpoint$",
28082781 }
28092782 opts.SkipAuthRoutes = []string{
28102783 "GET=^/skip/auth/routes/get",
2811− "^/foo/.*/bar$",
28122784 }
28132785 err := validation.Validate(opts)
28142786 assert.NoError(t, err)
@@ -2825,37 +2797,25 @@ func TestAllowedRequestWithForwardedUriHeader(t *testing.T) {
28252797 }{
28262798 {
28272799 name: "Regex GET allowed",
2828− method: http.MethodGet,
2800+ method: "GET",
28292801 url: "/skip/auth/regex",
28302802 allowed: true,
28312803 },
28322804 {
28332805 name: "Regex POST allowed ",
2834− method: http.MethodPost,
2806+ method: "POST",
28352807 url: "/skip/auth/regex",
28362808 allowed: true,
28372809 },
28382810 {
28392811 name: "Regex denied",
2840− method: http.MethodGet,
2812+ method: "GET",
28412813 url: "/wrong/denied",
28422814 allowed: false,
28432815 },
2844− {
2845− name: "Regex allowed with fragment-free path",
2846− method: http.MethodGet,
2847− url: "/public/legit/endpoint",
2848− allowed: true,
2849− },
2850− {
2851− name: "Regex denied when X-Forwarded-Uri contains an encoded fragment suffix",
2852− method: http.MethodGet,
2853− url: "/public/secret%23/endpoint",
2854− allowed: false,
2855− },
28562816 {
28572817 name: "Route allowed",
2858− method: http.MethodGet,
2818+ method: "GET",
28592819 url: "/skip/auth/routes/get",
28602820 allowed: true,
28612821 },
@@ -2867,28 +2827,16 @@ func TestAllowedRequestWithForwardedUriHeader(t *testing.T) {
28672827 },
28682828 {
28692829 name: "Route denied with wrong path",
2870− method: http.MethodGet,
2830+ method: "GET",
28712831 url: "/skip/auth/routes/wrong/path",
28722832 allowed: false,
28732833 },
28742834 {
28752835 name: "Route denied with wrong path and method",
2876− method: http.MethodPost,
2836+ method: "POST",
28772837 url: "/skip/auth/routes/wrong/path",
28782838 allowed: false,
28792839 },
2880− {
2881− name: "Route allowed with fragment-free path",
2882− method: http.MethodGet,
2883− url: "/foo/public/bar",
2884− allowed: true,
2885− },
2886− {
2887− name: "Route denied when X-Forwarded-Uri contains an encoded fragment suffix",
2888− method: http.MethodGet,
2889− url: "/foo/secret%23/bar",
2890− allowed: false,
2891− },
28922840 }
28932841
28942842 for _, tc := range testCases {
@@ -2986,37 +2934,37 @@ func TestAllowedRequestNegateWithoutMethod(t *testing.T) {
29862934 }{
29872935 {
29882936 name: "Some static file allowed",
2989− method: http.MethodGet,
2937+ method: "GET",
29902938 url: "/static/file.txt",
29912939 allowed: true,
29922940 },
29932941 {
29942942 name: "POST to contact form allowed",
2995− method: http.MethodPost,
2943+ method: "POST",
29962944 url: "/contact",
29972945 allowed: true,
29982946 },
29992947 {
30002948 name: "Regex POST allowed",
3001− method: http.MethodPost,
2949+ method: "POST",
30022950 url: "/api/public-entity",
30032951 allowed: true,
30042952 },
30052953 {
30062954 name: "Regex POST with trailing slash allowed",
3007− method: http.MethodPost,
2955+ method: "POST",
30082956 url: "/api/public-entity/",
30092957 allowed: true,
30102958 },
30112959 {
30122960 name: "Regex GET api route denied",
3013− method: http.MethodGet,
2961+ method: "GET",
30142962 url: "/api/users",
30152963 allowed: false,
30162964 },
30172965 {
30182966 name: "Regex POST api route denied",
3019− method: http.MethodPost,
2967+ method: "POST",
30202968 url: "/api/users",
30212969 allowed: false,
30222970 },
@@ -3086,37 +3034,37 @@ func TestAllowedRequestNegateWithMethod(t *testing.T) {
30863034 }{
30873035 {
30883036 name: "Some static file allowed",
3089− method: http.MethodGet,
3037+ method: "GET",
30903038 url: "/static/file.txt",
30913039 allowed: true,
30923040 },
30933041 {
30943042 name: "POST to contact form not allowed",
3095− method: http.MethodPost,
3043+ method: "POST",
30963044 url: "/contact",
30973045 allowed: false,
30983046 },
30993047 {
31003048 name: "Regex POST allowed",
3101− method: http.MethodPost,
3049+ method: "POST",
31023050 url: "/api/public-entity",
31033051 allowed: true,
31043052 },
31053053 {
31063054 name: "Regex POST with trailing slash allowed",
3107− method: http.MethodPost,
3055+ method: "POST",
31083056 url: "/api/public-entity/",
31093057 allowed: true,
31103058 },
31113059 {
31123060 name: "Regex GET api route denied",
3113− method: http.MethodGet,
3061+ method: "GET",
31143062 url: "/api/users",
31153063 allowed: false,
31163064 },
31173065 {
31183066 name: "Regex POST api route denied",
3119− method: http.MethodPost,
3067+ method: "POST",
31203068 url: "/api/users",
31213069 allowed: false,
31223070 },
@@ -3256,7 +3204,7 @@ func TestProxyAllowedGroups(t *testing.T) {
32563204 t.Fatal(err)
32573205 }
32583206
3259− test.req, _ = http.NewRequest(http.MethodGet, fmt.Sprintf("/%s", tt.querystring), nil)
3207+ test.req, _ = http.NewRequest("GET", fmt.Sprintf("/%s", tt.querystring), nil)
32603208
32613209 test.req.Header.Add("accept", applicationJSON)
32623210 err = test.SaveSession(session)
@@ -3400,7 +3348,7 @@ func TestAuthOnlyAllowedGroupsWithSkipMethods(t *testing.T) {
34003348 {
34013349 name: "UserWithGroupSkipAuthPreflight",
34023350 groups: []string{"a", "c"},
3403− method: http.MethodOptions,
3351+ method: "OPTIONS",
34043352 ip: "1.2.3.5:43670",
34053353 withSession: true,
34063354 expectedStatusCode: http.StatusAccepted,
@@ -3408,7 +3356,7 @@ func TestAuthOnlyAllowedGroupsWithSkipMethods(t *testing.T) {
34083356 {
34093357 name: "UserWithGroupTrustedIp",
34103358 groups: []string{"a", "c"},
3411− method: http.MethodGet,
3359+ method: "GET",
34123360 ip: "1.2.3.4:43670",
34133361 withSession: true,
34143362 expectedStatusCode: http.StatusAccepted,
@@ -3416,7 +3364,7 @@ func TestAuthOnlyAllowedGroupsWithSkipMethods(t *testing.T) {
34163364 {
34173365 name: "UserWithoutGroupSkipAuthPreflight",
34183366 groups: []string{"c"},
3419− method: http.MethodOptions,
3367+ method: "OPTIONS",
34203368 ip: "1.2.3.5:43670",
34213369 withSession: true,
34223370 expectedStatusCode: http.StatusForbidden,
@@ -3424,21 +3372,21 @@ func TestAuthOnlyAllowedGroupsWithSkipMethods(t *testing.T) {
34243372 {
34253373 name: "UserWithoutGroupTrustedIp",
34263374 groups: []string{"c"},
3427− method: http.MethodGet,
3375+ method: "GET",
34283376 ip: "1.2.3.4:43670",
34293377 withSession: true,
34303378 expectedStatusCode: http.StatusForbidden,
34313379 },
34323380 {
34333381 name: "UserWithoutSessionSkipAuthPreflight",
3434− method: http.MethodOptions,
3382+ method: "OPTIONS",
34353383 ip: "1.2.3.5:43670",
34363384 withSession: false,
34373385 expectedStatusCode: http.StatusAccepted,
34383386 },
34393387 {
34403388 name: "UserWithoutSessionTrustedIp",
3441− method: http.MethodGet,
3389+ method: "GET",
34423390 ip: "1.2.3.4:43670",
34433391 withSession: false,
34443392 expectedStatusCode: http.StatusAccepted,
@@ -3790,14 +3738,14 @@ func TestIdTokenPlaceholderInSignOut(t *testing.T) {
37903738
37913739 // Save the required session
37923740 rw := httptest.NewRecorder()
3793− req, _ := http.NewRequest(http.MethodGet, "/", nil)
3741+ req, _ := http.NewRequest("GET", "/", nil)
37943742 err = proxy.sessionStore.Save(rw, req, session)
37953743 assert.NoError(t, err)
37963744
37973745 rw = httptest.NewRecorder()
37983746
37993747 rdUrl := url.QueryEscape("https://my-oidc-provider.example.com/sign_out_page?id_token_hint={id_token}&post_logout_redirect_uri=https://my-app.example.com/")
3800− req, _ = http.NewRequest(http.MethodGet, "/oauth2/sign_out?rd="+rdUrl, nil)
3748+ req, _ = http.NewRequest("GET", "/oauth2/sign_out?rd="+rdUrl, nil)
38013749 req = middlewareapi.AddRequestScope(req, &middlewareapi.RequestScope{
38023750 RequestID: "11111111-2222-4333-8444-555555555555",
38033751 Session: session,