mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 17:28:31 +02:00
refactor(rules): simplify nested block detection by removing @ prefix requirement
Changes the nested block syntax detection from requiring `@`
as the first non-space character on a line to using a line-ending brace heuristic.
The parser now recognizes nested blocks when a line ends with an unquoted `{`,
simplifying the syntax and removing the mandatory `@` prefix while maintaining the same functionality.
This commit is contained in:
@@ -79,7 +79,7 @@ header Host example.com {
|
||||
name: "same condition with terminating handler inside if block",
|
||||
rules: `
|
||||
header Host example.com {
|
||||
@default {
|
||||
default {
|
||||
error 404 "not found"
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ header Host example.com {
|
||||
name: "same condition with terminating handler across if else block",
|
||||
rules: `
|
||||
header Host example.com {
|
||||
@method GET {
|
||||
method GET {
|
||||
error 404 "not found"
|
||||
} else {
|
||||
redirect https://example.com
|
||||
@@ -111,7 +111,7 @@ header Host example.com {
|
||||
name: "same condition with non terminating if branch in if else block",
|
||||
rules: `
|
||||
header Host example.com {
|
||||
@method GET {
|
||||
method GET {
|
||||
set resp_header X-Test first
|
||||
} else {
|
||||
error 404 "not found"
|
||||
|
||||
Reference in New Issue
Block a user