@@ -202,7 +202,7 @@ func TestGatewayGet(t *testing.T) {
202
202
{"example.man" , "/" , http .StatusOK , "fnord" },
203
203
} {
204
204
var c http.Client
205
- r , err := http .NewRequest ("GET" , ts .URL + test .path , nil )
205
+ r , err := http .NewRequest (http . MethodGet , ts .URL + test .path , nil )
206
206
if err != nil {
207
207
t .Fatal (err )
208
208
}
@@ -259,7 +259,7 @@ func TestIPNSHostnameRedirect(t *testing.T) {
259
259
ns ["/ipns/example.net" ] = path .FromString (k .String ())
260
260
261
261
// make request to directory containing index.html
262
- req , err := http .NewRequest ("GET" , ts .URL + "/foo" , nil )
262
+ req , err := http .NewRequest (http . MethodGet , ts .URL + "/foo" , nil )
263
263
if err != nil {
264
264
t .Fatal (err )
265
265
}
@@ -282,7 +282,7 @@ func TestIPNSHostnameRedirect(t *testing.T) {
282
282
}
283
283
284
284
// make request with prefix to directory containing index.html
285
- req , err = http .NewRequest ("GET" , ts .URL + "/foo" , nil )
285
+ req , err = http .NewRequest (http . MethodGet , ts .URL + "/foo" , nil )
286
286
if err != nil {
287
287
t .Fatal (err )
288
288
}
@@ -306,7 +306,7 @@ func TestIPNSHostnameRedirect(t *testing.T) {
306
306
}
307
307
308
308
// make sure /version isn't exposed
309
- req , err = http .NewRequest ("GET" , ts .URL + "/version" , nil )
309
+ req , err = http .NewRequest (http . MethodGet , ts .URL + "/version" , nil )
310
310
if err != nil {
311
311
t .Fatal (err )
312
312
}
@@ -359,7 +359,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
359
359
ns ["/ipns/example.net" ] = path .FromString (k .String ())
360
360
361
361
// make request to directory listing
362
- req , err := http .NewRequest ("GET" , ts .URL + "/foo%3F%20%23%3C%27/" , nil )
362
+ req , err := http .NewRequest (http . MethodGet , ts .URL + "/foo%3F%20%23%3C%27/" , nil )
363
363
if err != nil {
364
364
t .Fatal (err )
365
365
}
@@ -392,7 +392,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
392
392
}
393
393
394
394
// make request to directory listing at root
395
- req , err = http .NewRequest ("GET" , ts .URL , nil )
395
+ req , err = http .NewRequest (http . MethodGet , ts .URL , nil )
396
396
if err != nil {
397
397
t .Fatal (err )
398
398
}
@@ -425,7 +425,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
425
425
}
426
426
427
427
// make request to directory listing
428
- req , err = http .NewRequest ("GET" , ts .URL + "/foo%3F%20%23%3C%27/bar/" , nil )
428
+ req , err = http .NewRequest (http . MethodGet , ts .URL + "/foo%3F%20%23%3C%27/bar/" , nil )
429
429
if err != nil {
430
430
t .Fatal (err )
431
431
}
@@ -458,7 +458,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
458
458
}
459
459
460
460
// make request to directory listing with prefix
461
- req , err = http .NewRequest ("GET" , ts .URL , nil )
461
+ req , err = http .NewRequest (http . MethodGet , ts .URL , nil )
462
462
if err != nil {
463
463
t .Fatal (err )
464
464
}
@@ -492,15 +492,15 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
492
492
}
493
493
494
494
// make request to directory listing with illegal prefix
495
- req , err = http .NewRequest ("GET" , ts .URL , nil )
495
+ req , err = http .NewRequest (http . MethodGet , ts .URL , nil )
496
496
if err != nil {
497
497
t .Fatal (err )
498
498
}
499
499
req .Host = "example.net"
500
500
req .Header .Set ("X-Ipfs-Gateway-Prefix" , "/bad-prefix" )
501
501
502
502
// make request to directory listing with evil prefix
503
- req , err = http .NewRequest ("GET" , ts .URL , nil )
503
+ req , err = http .NewRequest (http . MethodGet , ts .URL , nil )
504
504
if err != nil {
505
505
t .Fatal (err )
506
506
}
@@ -539,7 +539,7 @@ func TestCacheControlImmutable(t *testing.T) {
539
539
t .Logf ("test server url: %s" , ts .URL )
540
540
defer ts .Close ()
541
541
542
- req , err := http .NewRequest ("GET" , ts .URL + emptyDir + "/" , nil )
542
+ req , err := http .NewRequest (http . MethodGet , ts .URL + emptyDir + "/" , nil )
543
543
if err != nil {
544
544
t .Fatal (err )
545
545
}
@@ -566,7 +566,7 @@ func TestGoGetSupport(t *testing.T) {
566
566
defer ts .Close ()
567
567
568
568
// mimic go-get
569
- req , err := http .NewRequest ("GET" , ts .URL + emptyDir + "?go-get=1" , nil )
569
+ req , err := http .NewRequest (http . MethodGet , ts .URL + emptyDir + "?go-get=1" , nil )
570
570
if err != nil {
571
571
t .Fatal (err )
572
572
}
@@ -589,7 +589,7 @@ func TestVersion(t *testing.T) {
589
589
t .Logf ("test server url: %s" , ts .URL )
590
590
defer ts .Close ()
591
591
592
- req , err := http .NewRequest ("GET" , ts .URL + "/version" , nil )
592
+ req , err := http .NewRequest (http . MethodGet , ts .URL + "/version" , nil )
593
593
if err != nil {
594
594
t .Fatal (err )
595
595
}
0 commit comments