@@ -443,7 +443,7 @@ func (h *RequestHeader) SetRefererBytes(referer []byte) {
443
443
// Method returns HTTP request method.
444
444
func (h * RequestHeader ) Method () []byte {
445
445
if len (h .method ) == 0 {
446
- return strGet
446
+ return [] byte ( MethodGet )
447
447
}
448
448
return h .method
449
449
}
@@ -503,47 +503,47 @@ func (h *RequestHeader) SetRequestURIBytes(requestURI []byte) {
503
503
504
504
// IsGet returns true if request method is GET.
505
505
func (h * RequestHeader ) IsGet () bool {
506
- return bytes . Equal (h .Method (), strGet )
506
+ return string (h .Method ()) == MethodGet
507
507
}
508
508
509
509
// IsPost returns true if request method is POST.
510
510
func (h * RequestHeader ) IsPost () bool {
511
- return bytes . Equal (h .Method (), strPost )
511
+ return string (h .Method ()) == MethodPost
512
512
}
513
513
514
514
// IsPut returns true if request method is PUT.
515
515
func (h * RequestHeader ) IsPut () bool {
516
- return bytes . Equal (h .Method (), strPut )
516
+ return string (h .Method ()) == MethodPut
517
517
}
518
518
519
519
// IsHead returns true if request method is HEAD.
520
520
func (h * RequestHeader ) IsHead () bool {
521
- return bytes . Equal (h .Method (), strHead )
521
+ return string (h .Method ()) == MethodHead
522
522
}
523
523
524
524
// IsDelete returns true if request method is DELETE.
525
525
func (h * RequestHeader ) IsDelete () bool {
526
- return bytes . Equal (h .Method (), strDelete )
526
+ return string (h .Method ()) == MethodDelete
527
527
}
528
528
529
529
// IsConnect returns true if request method is CONNECT.
530
530
func (h * RequestHeader ) IsConnect () bool {
531
- return bytes . Equal (h .Method (), strConnect )
531
+ return string (h .Method ()) == MethodConnect
532
532
}
533
533
534
534
// IsOptions returns true if request method is OPTIONS.
535
535
func (h * RequestHeader ) IsOptions () bool {
536
- return bytes . Equal (h .Method (), strOptions )
536
+ return string (h .Method ()) == MethodOptions
537
537
}
538
538
539
539
// IsTrace returns true if request method is TRACE.
540
540
func (h * RequestHeader ) IsTrace () bool {
541
- return bytes . Equal (h .Method (), strTrace )
541
+ return string (h .Method ()) == MethodTrace
542
542
}
543
543
544
544
// IsPatch returns true if request method is PATCH.
545
545
func (h * RequestHeader ) IsPatch () bool {
546
- return bytes . Equal (h .Method (), strPatch )
546
+ return string (h .Method ()) == MethodPatch
547
547
}
548
548
549
549
// IsHTTP11 returns true if the request is HTTP/1.1.
0 commit comments