summaryrefslogtreecommitdiff
path: root/caddyconfig/caddyfile
diff options
context:
space:
mode:
Diffstat (limited to 'caddyconfig/caddyfile')
-rwxr-xr-xcaddyconfig/caddyfile/lexer.go5
-rwxr-xr-xcaddyconfig/caddyfile/lexer_test.go6
2 files changed, 11 insertions, 0 deletions
diff --git a/caddyconfig/caddyfile/lexer.go b/caddyconfig/caddyfile/lexer.go
index 0ddad0e..687ff90 100755
--- a/caddyconfig/caddyfile/lexer.go
+++ b/caddyconfig/caddyfile/lexer.go
@@ -153,6 +153,11 @@ func (l *lexer) next() bool {
}
}
+ if escaped {
+ val = append(val, '\\')
+ escaped = false
+ }
+
val = append(val, ch)
}
}
diff --git a/caddyconfig/caddyfile/lexer_test.go b/caddyconfig/caddyfile/lexer_test.go
index ce2e147..9105eb5 100755
--- a/caddyconfig/caddyfile/lexer_test.go
+++ b/caddyconfig/caddyfile/lexer_test.go
@@ -152,6 +152,12 @@ func TestLexer(t *testing.T) {
},
},
{
+ input: `un\escapable`,
+ expected: []Token{
+ {Line: 1, Text: `un\escapable`},
+ },
+ },
+ {
input: `A "quoted value with line
break inside" {
foobar