Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
6b66b19d
Commit
6b66b19d
authored
Apr 17, 2017
by
Matt Holt
Committed by
GitHub
Apr 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1583 from tw4452852/1529
log: only allow new roller related options in a block
parents
33257de2
702dec06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
caddyhttp/log/setup.go
caddyhttp/log/setup.go
+7
-6
caddyhttp/log/setup_test.go
caddyhttp/log/setup_test.go
+2
-0
No files found.
caddyhttp/log/setup.go
View file @
6b66b19d
...
@@ -41,12 +41,13 @@ func logParse(c *caddy.Controller) ([]*Rule, error) {
...
@@ -41,12 +41,13 @@ func logParse(c *caddy.Controller) ([]*Rule, error) {
}
}
where
:=
c
.
Val
()
where
:=
c
.
Val
()
if
httpserver
.
IsLogRollerSubdirective
(
what
)
{
// only support roller related options inside a block
var
err
error
if
!
httpserver
.
IsLogRollerSubdirective
(
what
)
{
err
=
httpserver
.
ParseRoller
(
logRoller
,
what
,
where
)
return
nil
,
c
.
ArgErr
()
if
err
!=
nil
{
}
return
nil
,
err
}
if
err
:=
httpserver
.
ParseRoller
(
logRoller
,
what
,
where
);
err
!=
nil
{
return
nil
,
err
}
}
}
}
...
...
caddyhttp/log/setup_test.go
View file @
6b66b19d
...
@@ -205,6 +205,8 @@ func TestLogParse(t *testing.T) {
...
@@ -205,6 +205,8 @@ func TestLogParse(t *testing.T) {
Format
:
"{when}"
,
Format
:
"{when}"
,
}},
}},
}}},
}}},
{
`log access.log { rotate_size }`
,
true
,
nil
},
{
`log access.log { invalid_option 1 }`
,
true
,
nil
},
}
}
for
i
,
test
:=
range
tests
{
for
i
,
test
:=
range
tests
{
c
:=
caddy
.
NewTestController
(
"http"
,
test
.
inputLogRules
)
c
:=
caddy
.
NewTestController
(
"http"
,
test
.
inputLogRules
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment