fix(backend): added toUpper() method for network requests to avoid ignoring http methods in low case

This commit is contained in:
Alexander Zavorotynskiy 2023-06-12 11:45:26 +02:00
parent 4180780b13
commit 73a4339db2

View file

@ -1,9 +1,12 @@
package url
import "strings"
var METHODS = []string{"GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"}
var TYPES = []string{"other", "script", "stylesheet", "fetch", "img", "media"}
func EnsureMethod(method string) string {
method = strings.ToUpper(method)
for _, m := range METHODS {
if m == method {
return method