@@ -18,11 +18,9 @@ import (
1818 "github.com/valyala/fasttemplate"
1919)
2020
21- var (
22- ErrEndpointNotFound = fmt .Errorf ("no matching endpoint found" )
23- )
21+ var ErrEndpointNotFound = fmt .Errorf ("no matching endpoint found" )
2422
25- var validHTTPMethods = []string {http .MethodGet , http .MethodPost , http .MethodPut , http .MethodPost , http .MethodDelete }
23+ var validHTTPMethods = []string {http .MethodGet , http .MethodPost , http .MethodPut , http .MethodDelete , http .MethodPatch }
2624
2725const (
2826 EndpointTypeNormal = "normal"
@@ -91,7 +89,7 @@ func (s MockHandler) ValidateConfig() error {
9189 }
9290 }
9391 if ! validMethod {
94- return fmt .Errorf (fmt . Sprintf ( "Invalid HTTP method (%s) for endpoint %s. Allowed: %+v" , endpoint .Method , endpoint .Uri , validHTTPMethods ) )
92+ return fmt .Errorf ("invalid HTTP method (%s) for endpoint %s. Allowed: %+v" , endpoint .Method , endpoint .Uri , validHTTPMethods )
9593 }
9694
9795 validType := false
@@ -102,7 +100,7 @@ func (s MockHandler) ValidateConfig() error {
102100 }
103101 }
104102 if ! validType {
105- return fmt .Errorf (fmt . Sprintf ( "Invalid endpoint type (%s) for endpoint %s. Allowed: %+v" , endpoint .Type , endpoint .Uri , validEndpointTypes ) )
103+ return fmt .Errorf ("invalid endpoint type (%s) for endpoint %s. Allowed: %+v" , endpoint .Type , endpoint .Uri , validEndpointTypes )
106104 }
107105
108106 if endpoint .Template != "" {
0 commit comments