diff options
author | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-04-01 02:27:52 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@mullvad.net> | 2022-04-01 02:56:42 +0200 |
commit | aa903b2f5356f35a486a8e7e6ef92e9db332748e (patch) | |
tree | 3fff6448da782fdebffe9d24bf9b70edca14d396 /pkg/instance/instance.go | |
parent | b09d20111227be5e6d5126ec905b44a7a4e96b0d (diff) |
fix non-compliant use of HTTP status code 405
See RFC 7231, ยง6.5.5.
Diffstat (limited to 'pkg/instance/instance.go')
-rw-r--r-- | pkg/instance/instance.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 7ade955..f62922e 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -51,6 +51,11 @@ func (i *Instance) Handlers() []Handler { } } +// checkHTTPMethod checks if an HTTP method is supported +func (i *Instance) checkHTTPMethod(m string) bool { + return m == http.MethodGet || m == http.MethodPost +} + func (i *Instance) leafRequestFromHTTP(ctx context.Context, r *http.Request) (*requests.Leaf, error) { var req requests.Leaf if err := req.FromASCII(r.Body); err != nil { |