aboutsummaryrefslogtreecommitdiff
path: root/lib/http
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-03-26 13:39:33 +0700
committerShulhan <ms@kilabit.info>2023-03-26 13:45:53 +0700
commit0a0d647eb485a68be4169e8ca3f4a8a3f1b2c511 (patch)
tree1fdd9b9511f3dc4a98c12fc045345a77e6acc87f /lib/http
parent2f5aae2820ebc27225504736aa25bca66cceee0d (diff)
downloadpakakeh.go-0a0d647eb485a68be4169e8ca3f4a8a3f1b2c511.tar.xz
lib/http: fix empty branch when parsing range
If the range is "x-y-", the function should skip the position.
Diffstat (limited to 'lib/http')
-rw-r--r--lib/http/range.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/http/range.go b/lib/http/range.go
index eb97e0ef..57404a43 100644
--- a/lib/http/range.go
+++ b/lib/http/range.go
@@ -151,6 +151,8 @@ func ParseRange(v string) (r Range) {
tok, delim = par.TokenTrimSpace()
if delim == '-' {
// Invalid range "start-end-"
+ skipPosition(par, delim)
+ continue
}
if len(tok) == 0 {
if start == 0 {