diff --git a/internal/route/rules/do_blocks.go b/internal/route/rules/do_blocks.go index 96af2060..056ce6ed 100644 --- a/internal/route/rules/do_blocks.go +++ b/internal/route/rules/do_blocks.go @@ -417,10 +417,6 @@ func parseDoWithBlocks(src string) (handlers []CommandHandler, err error) { } // Not a nested block; parse the rest of this line as a command. - lineEnd = pos - for lineEnd < length && src[lineEnd] != '\n' { - lineEnd++ - } if lerr := appendLineCommand(src[pos:lineEnd]); lerr != nil { return nil, lerr } diff --git a/internal/route/rules/on.go b/internal/route/rules/on.go index cd6af3fc..64e28108 100644 --- a/internal/route/rules/on.go +++ b/internal/route/rules/on.go @@ -651,7 +651,9 @@ func forEachPipePart(s string, fn func(part string)) { } case '|': if quote == 0 && brackets == 0 { - fn(strings.TrimSpace(s[start:i])) + if part := strings.TrimSpace(s[start:i]); part != "" { + fn(part) + } start = i + 1 } }