diff --git a/internal/http/request/parser/header/public.go b/internal/http/request/parser/header/public.go index 36be125..c00b6d0 100644 --- a/internal/http/request/parser/header/public.go +++ b/internal/http/request/parser/header/public.go @@ -1,7 +1,7 @@ package header import ( - "regexp" + // "regexp" "fmt" "strings" "bytes" @@ -33,18 +33,8 @@ func Parse(b []byte) (*T, error) { default: inst.Name = UNKNOWN } - /* (4) Check format */ - checker := regexp.MustCompile(`^(?:[^,]+,\s*)*[^,]+$`) - if !checker.Match(parts[1]) { - return nil, fmt.Errorf("Invalid HTTP header value format '%s'", parts[1]); - } - - /* (5) Normalise format */ - normaliser := regexp.MustCompile(`,\s+`) - values := normaliser.ReplaceAll(parts[1], []byte(",")) - - /* (5) Split values */ - inst.Values = bytes.Split(values, []byte(",")) + /* (4) Split values */ + inst.Values = bytes.Split(parts[1], []byte(", ")) return inst, nil