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
Łukasz Nowak
caddy
Commits
80db177f
Commit
80db177f
authored
9 years ago
by
Alexander Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix vet warnings about unkeyed fields
Signed-off-by:
Alexander Morozov
<
lk4d4@docker.com
>
parent
3d1cac31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
config/setup/gzip.go
config/setup/gzip.go
+2
-2
config/setup/rewrite_test.go
config/setup/rewrite_test.go
+8
-8
No files found.
config/setup/gzip.go
View file @
80db177f
...
...
@@ -27,8 +27,8 @@ func gzipParse(c *Controller) ([]gzip.Config, error) {
for
c
.
Next
()
{
config
:=
gzip
.
Config
{}
pathFilter
:=
gzip
.
PathFilter
{
make
(
gzip
.
Set
)}
extFilter
:=
gzip
.
ExtFilter
{
make
(
gzip
.
Set
)}
pathFilter
:=
gzip
.
PathFilter
{
IgnoredPaths
:
make
(
gzip
.
Set
)}
extFilter
:=
gzip
.
ExtFilter
{
Exts
:
make
(
gzip
.
Set
)}
// No extra args expected
if
len
(
c
.
RemainingArgs
())
>
0
{
...
...
This diff is collapsed.
Click to expand it.
config/setup/rewrite_test.go
View file @
80db177f
...
...
@@ -42,17 +42,17 @@ func TestRewriteParse(t *testing.T) {
expected
[]
rewrite
.
Rule
}{
{
`rewrite /from /to`
,
false
,
[]
rewrite
.
Rule
{
rewrite
.
SimpleRule
{
"/from"
,
"/to"
},
rewrite
.
SimpleRule
{
From
:
"/from"
,
To
:
"/to"
},
}},
{
`rewrite /from /to
rewrite a b`
,
false
,
[]
rewrite
.
Rule
{
rewrite
.
SimpleRule
{
"/from"
,
"/to"
},
rewrite
.
SimpleRule
{
"a"
,
"b"
},
rewrite
.
SimpleRule
{
From
:
"/from"
,
To
:
"/to"
},
rewrite
.
SimpleRule
{
From
:
"a"
,
To
:
"b"
},
}},
{
`rewrite a`
,
true
,
[]
rewrite
.
Rule
{}},
{
`rewrite`
,
true
,
[]
rewrite
.
Rule
{}},
{
`rewrite a b c`
,
true
,
[]
rewrite
.
Rule
{
rewrite
.
SimpleRule
{
"a"
,
"b"
},
rewrite
.
SimpleRule
{
From
:
"a"
,
To
:
"b"
},
}},
}
...
...
@@ -98,14 +98,14 @@ func TestRewriteParse(t *testing.T) {
r .*
to /to
}`
,
false
,
[]
rewrite
.
Rule
{
&
rewrite
.
RegexpRule
{
"/"
,
"/to"
,
nil
,
regexp
.
MustCompile
(
".*"
)},
&
rewrite
.
RegexpRule
{
Base
:
"/"
,
To
:
"/to"
,
Regexp
:
regexp
.
MustCompile
(
".*"
)},
}},
{
`rewrite {
regexp .*
to /to
ext / html txt
}`
,
false
,
[]
rewrite
.
Rule
{
&
rewrite
.
RegexpRule
{
"/"
,
"/to"
,
[]
string
{
"/"
,
"html"
,
"txt"
},
regexp
.
MustCompile
(
".*"
)},
&
rewrite
.
RegexpRule
{
Base
:
"/"
,
To
:
"/to"
,
Exts
:
[]
string
{
"/"
,
"html"
,
"txt"
},
Regexp
:
regexp
.
MustCompile
(
".*"
)},
}},
{
`rewrite /path {
r rr
...
...
@@ -116,8 +116,8 @@ func TestRewriteParse(t *testing.T) {
to /to
}
`
,
false
,
[]
rewrite
.
Rule
{
&
rewrite
.
RegexpRule
{
"/path"
,
"/dest"
,
nil
,
regexp
.
MustCompile
(
"rr"
)},
&
rewrite
.
RegexpRule
{
"/"
,
"/to"
,
nil
,
regexp
.
MustCompile
(
"[a-z]+"
)},
&
rewrite
.
RegexpRule
{
Base
:
"/path"
,
To
:
"/dest"
,
Regexp
:
regexp
.
MustCompile
(
"rr"
)},
&
rewrite
.
RegexpRule
{
Base
:
"/"
,
To
:
"/to"
,
Regexp
:
regexp
.
MustCompile
(
"[a-z]+"
)},
}},
{
`rewrite {
to /to
...
...
This diff is collapsed.
Click to expand it.
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