summaryrefslogtreecommitdiff
path: root/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'parse.go')
-rw-r--r--parse.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/parse.go b/parse.go
index 886aa2d..e1b375f 100644
--- a/parse.go
+++ b/parse.go
@@ -265,9 +265,18 @@ func parseServerDirectives(server *Server, buf *bufio.Reader) error {
return nil
}
+func emptyExceptTemplates(mods *Modifiers) bool {
+ if mods == nil {
+ return true
+ }
+ cpy := *mods
+ cpy.Templates = nil
+ return cpy.Empty()
+}
+
func validateRoute(serverType string, dir *RouteDirective) error {
- if dir.Type == "git" && !dir.Modifiers.Empty() {
- return errors.New("git directives don't support 'with' modifiers")
+ if dir.Type == "git" && !emptyExceptTemplates(&dir.Modifiers) {
+ return errors.New("unsupported 'with' modifier on 'git' directive")
}
if dir.Type == "cgi" && (dir.Modifiers.Exec || dir.Modifiers.DirList || dir.Modifiers.DirDefault != "") {