diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-04-29 17:38:07 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-04-29 17:38:07 -0600 |
commit | fcea3099cb2dce7f953e46389f83b6f9b58bef86 (patch) | |
tree | a8b5963c85e87a24555ba7aa71477365b8f58662 /spartan/request.go | |
parent | 039c58c9d00a4a5886fa99d7c7d472e6d02d6a67 (diff) |
tests and bugfixes to spartan request parsing
Diffstat (limited to 'spartan/request.go')
-rw-r--r-- | spartan/request.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spartan/request.go b/spartan/request.go index 331b68c..ca1159b 100644 --- a/spartan/request.go +++ b/spartan/request.go @@ -37,7 +37,7 @@ func ParseRequest(rdr io.Reader) (*gus.Request, int, error) { if !ok { return nil, 0, InvalidRequestLine } - path, rest, ok := strings.Cut(line, " ") + path, rest, ok := strings.Cut(rest, " ") if !ok { return nil, 0, InvalidRequestLine } @@ -46,7 +46,7 @@ func ParseRequest(rdr io.Reader) (*gus.Request, int, error) { return nil, 0, InvalidRequestLineEnding } - contentlen, err := strconv.Atoi(line[:len(line)-2]) + contentlen, err := strconv.Atoi(rest[:len(rest)-2]) if err != nil { return nil, 0, err } |