Skip to content

Commit 6a086eb

Browse files
authored
fix(nntp): handle open-ended OVER range like '5-' (#75)
1 parent 11f7b8e commit 6a086eb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/news/nntpd/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ func parseRange(spec string) (low, high int64) {
181181
if err != nil {
182182
return 0, 0 // malformed — empty range
183183
}
184+
if parts[1] == "" {
185+
return l, math.MaxInt64 // open-ended range like "5-"
186+
}
184187
h, err := strconv.ParseInt(parts[1], 10, 64)
185188
if err != nil {
186189
return 0, 0 // malformed — empty range

0 commit comments

Comments
 (0)