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
45a3d0b5
Commit
45a3d0b5
authored
Sep 05, 2016
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix misspellings
parent
a1223041
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
26 additions
and
26 deletions
+26
-26
caddyhttp/basicauth/basicauth.go
caddyhttp/basicauth/basicauth.go
+1
-1
caddyhttp/browse/browse_test.go
caddyhttp/browse/browse_test.go
+2
-2
caddyhttp/browse/setup_test.go
caddyhttp/browse/setup_test.go
+3
-3
caddyhttp/extensions/ext.go
caddyhttp/extensions/ext.go
+1
-1
caddyhttp/httpserver/condition_test.go
caddyhttp/httpserver/condition_test.go
+1
-1
caddyhttp/pprof/pprof_test.go
caddyhttp/pprof/pprof_test.go
+1
-1
caddyhttp/redirect/setup_test.go
caddyhttp/redirect/setup_test.go
+11
-11
caddyhttp/websocket/websocket.go
caddyhttp/websocket/websocket.go
+1
-1
caddytls/maintain.go
caddytls/maintain.go
+1
-1
commands_test.go
commands_test.go
+2
-2
startupshutdown/startupshutdown_test.go
startupshutdown/startupshutdown_test.go
+2
-2
No files found.
caddyhttp/basicauth/basicauth.go
View file @
45a3d0b5
...
...
@@ -68,7 +68,7 @@ func (a BasicAuth) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
return
a
.
Next
.
ServeHTTP
(
w
,
r
)
}
// Pass-thr
u
when no paths match
// Pass-thr
ough
when no paths match
return
a
.
Next
.
ServeHTTP
(
w
,
r
)
}
...
...
caddyhttp/browse/browse_test.go
View file @
45a3d0b5
...
...
@@ -96,7 +96,7 @@ func TestSort(t *testing.T) {
func
TestBrowseHTTPMethods
(
t
*
testing
.
T
)
{
tmpl
,
err
:=
template
.
ParseFiles
(
"testdata/photos.tpl"
)
if
err
!=
nil
{
t
.
Fatalf
(
"An error occured while parsing the template: %v"
,
err
)
t
.
Fatalf
(
"An error occur
r
ed while parsing the template: %v"
,
err
)
}
b
:=
Browse
{
...
...
@@ -134,7 +134,7 @@ func TestBrowseHTTPMethods(t *testing.T) {
func
TestBrowseTemplate
(
t
*
testing
.
T
)
{
tmpl
,
err
:=
template
.
ParseFiles
(
"testdata/photos.tpl"
)
if
err
!=
nil
{
t
.
Fatalf
(
"An error occured while parsing the template: %v"
,
err
)
t
.
Fatalf
(
"An error occur
r
ed while parsing the template: %v"
,
err
)
}
b
:=
Browse
{
...
...
caddyhttp/browse/setup_test.go
View file @
45a3d0b5
...
...
@@ -52,15 +52,15 @@ func TestSetup(t *testing.T) {
c
:=
caddy
.
NewTestController
(
"http"
,
test
.
input
)
err
:=
setup
(
c
)
if
err
!=
nil
&&
!
test
.
shouldErr
{
t
.
Errorf
(
"Test case #%d rec
ie
ved an error of %v"
,
i
,
err
)
t
.
Errorf
(
"Test case #%d rec
ei
ved an error of %v"
,
i
,
err
)
}
if
test
.
expectedPathScope
==
nil
{
continue
}
mids
:=
httpserver
.
GetConfig
(
c
)
.
Middleware
()
mid
:=
mids
[
len
(
mids
)
-
1
]
rec
ie
vedConfigs
:=
mid
(
nil
)
.
(
Browse
)
.
Configs
for
j
,
config
:=
range
rec
ie
vedConfigs
{
rec
ei
vedConfigs
:=
mid
(
nil
)
.
(
Browse
)
.
Configs
for
j
,
config
:=
range
rec
ei
vedConfigs
{
if
config
.
PathScope
!=
test
.
expectedPathScope
[
j
]
{
t
.
Errorf
(
"Test case #%d expected a pathscope of %v, but got %v"
,
i
,
test
.
expectedPathScope
,
config
.
PathScope
)
}
...
...
caddyhttp/extensions/ext.go
View file @
45a3d0b5
...
...
@@ -21,7 +21,7 @@ type Ext struct {
// Next handler in the chain
Next
httpserver
.
Handler
// Path to
ther root of the site
// Path to
site root
Root
string
// List of extensions to try
...
...
caddyhttp/httpserver/condition_test.go
View file @
45a3d0b5
...
...
@@ -206,7 +206,7 @@ func TestSetupIfMatcher(t *testing.T) {
}`
,
true
,
IfMatcher
{},
},
{
`test {
if a isnt b
if a isn
'
t b
}`
,
true
,
IfMatcher
{},
},
{
`test {
...
...
caddyhttp/pprof/pprof_test.go
View file @
45a3d0b5
...
...
@@ -45,7 +45,7 @@ func TestServeHTTP(t *testing.T) {
t
.
Errorf
(
"Test two: Expected nil error, but got: %v"
,
err
)
}
if
w
.
Body
.
String
()
!=
"content"
{
t
.
Errorf
(
"Expected pprof to pass the request thr
u
, but it didn't; got: %s"
,
w
.
Body
.
String
())
t
.
Errorf
(
"Expected pprof to pass the request thr
ough
, but it didn't; got: %s"
,
w
.
Body
.
String
())
}
}
...
...
caddyhttp/redirect/setup_test.go
View file @
45a3d0b5
...
...
@@ -69,25 +69,25 @@ func TestSetup(t *testing.T) {
c
:=
caddy
.
NewTestController
(
"http"
,
test
.
input
)
err
:=
setup
(
c
)
if
err
!=
nil
&&
!
test
.
shouldErr
{
t
.
Errorf
(
"Test case #%d rec
ie
ved an error of %v"
,
j
,
err
)
t
.
Errorf
(
"Test case #%d rec
ei
ved an error of %v"
,
j
,
err
)
}
else
if
test
.
shouldErr
{
continue
}
mids
:=
httpserver
.
GetConfig
(
c
)
.
Middleware
()
rec
ie
vedRules
:=
mids
[
len
(
mids
)
-
1
](
nil
)
.
(
Redirect
)
.
Rules
rec
ei
vedRules
:=
mids
[
len
(
mids
)
-
1
](
nil
)
.
(
Redirect
)
.
Rules
for
i
,
rec
ievedRule
:=
range
recie
vedRules
{
if
rec
ie
vedRule
.
FromPath
!=
test
.
expectedRules
[
i
]
.
FromPath
{
t
.
Errorf
(
"Test case #%d.%d expected a from path of %s, but rec
ieved a from path of %s"
,
j
,
i
,
test
.
expectedRules
[
i
]
.
FromPath
,
recie
vedRule
.
FromPath
)
for
i
,
rec
eivedRule
:=
range
recei
vedRules
{
if
rec
ei
vedRule
.
FromPath
!=
test
.
expectedRules
[
i
]
.
FromPath
{
t
.
Errorf
(
"Test case #%d.%d expected a from path of %s, but rec
eived a from path of %s"
,
j
,
i
,
test
.
expectedRules
[
i
]
.
FromPath
,
recei
vedRule
.
FromPath
)
}
if
rec
ie
vedRule
.
To
!=
test
.
expectedRules
[
i
]
.
To
{
t
.
Errorf
(
"Test case #%d.%d expected a TO path of %s, but rec
ieved a TO path of %s"
,
j
,
i
,
test
.
expectedRules
[
i
]
.
To
,
recie
vedRule
.
To
)
if
rec
ei
vedRule
.
To
!=
test
.
expectedRules
[
i
]
.
To
{
t
.
Errorf
(
"Test case #%d.%d expected a TO path of %s, but rec
eived a TO path of %s"
,
j
,
i
,
test
.
expectedRules
[
i
]
.
To
,
recei
vedRule
.
To
)
}
if
rec
ie
vedRule
.
Code
!=
test
.
expectedRules
[
i
]
.
Code
{
t
.
Errorf
(
"Test case #%d.%d expected a HTTP status code of %d, but rec
ieved a code of %d"
,
j
,
i
,
test
.
expectedRules
[
i
]
.
Code
,
recie
vedRule
.
Code
)
if
rec
ei
vedRule
.
Code
!=
test
.
expectedRules
[
i
]
.
Code
{
t
.
Errorf
(
"Test case #%d.%d expected a HTTP status code of %d, but rec
eived a code of %d"
,
j
,
i
,
test
.
expectedRules
[
i
]
.
Code
,
recei
vedRule
.
Code
)
}
if
gotMatcher
,
expectMatcher
:=
fmt
.
Sprint
(
rec
ie
vedRule
.
RequestMatcher
),
fmt
.
Sprint
(
test
.
expectedRules
[
i
]
.
RequestMatcher
);
gotMatcher
!=
expectMatcher
{
t
.
Errorf
(
"Test case #%d.%d expected a Matcher %s, but rec
ie
ved a Matcher %s"
,
j
,
i
,
expectMatcher
,
gotMatcher
)
if
gotMatcher
,
expectMatcher
:=
fmt
.
Sprint
(
rec
ei
vedRule
.
RequestMatcher
),
fmt
.
Sprint
(
test
.
expectedRules
[
i
]
.
RequestMatcher
);
gotMatcher
!=
expectMatcher
{
t
.
Errorf
(
"Test case #%d.%d expected a Matcher %s, but rec
ei
ved a Matcher %s"
,
j
,
i
,
expectMatcher
,
gotMatcher
)
}
}
}
...
...
caddyhttp/websocket/websocket.go
View file @
45a3d0b5
...
...
@@ -72,7 +72,7 @@ func (ws WebSocket) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, erro
}
}
// Didn't match a websocket path, so pass-thr
u
// Didn't match a websocket path, so pass-thr
ough
return
ws
.
Next
.
ServeHTTP
(
w
,
r
)
}
...
...
caddytls/maintain.go
View file @
45a3d0b5
...
...
@@ -248,7 +248,7 @@ func DeleteOldStapleFiles() {
}
for
_
,
file
:=
range
files
{
if
file
.
IsDir
()
{
// w
ie
rd, what's a folder doing inside the OCSP cache?
// w
ei
rd, what's a folder doing inside the OCSP cache?
continue
}
stapleFile
:=
filepath
.
Join
(
ocspFolder
,
file
.
Name
())
...
...
commands_test.go
View file @
45a3d0b5
...
...
@@ -12,7 +12,7 @@ func TestParseUnixCommand(t *testing.T) {
input
string
expected
[]
string
}{
// 0 - em
tp
y command
// 0 - em
pt
y command
{
input
:
``
,
expected
:
[]
string
{},
...
...
@@ -181,7 +181,7 @@ func TestSplitCommandAndArgs(t *testing.T) {
expectedArgs
[]
string
expectedErrContent
string
}{
// 0 - em
tp
y command
// 0 - em
pt
y command
{
input
:
``
,
expectedCommand
:
``
,
...
...
startupshutdown/startupshutdown_test.go
View file @
45a3d0b5
...
...
@@ -56,11 +56,11 @@ func TestStartup(t *testing.T) {
}
err
=
registeredFunction
()
if
err
!=
nil
&&
!
test
.
shouldExecutionErr
{
t
.
Errorf
(
"Test %d rec
ie
ved an error of:
\n
%v"
,
i
,
err
)
t
.
Errorf
(
"Test %d rec
ei
ved an error of:
\n
%v"
,
i
,
err
)
}
err
=
os
.
Remove
(
osSenitiveTestDir
)
if
err
!=
nil
&&
!
test
.
shouldRemoveErr
{
t
.
Errorf
(
"Test %d rec
ie
ved an error of:
\n
%v"
,
i
,
err
)
t
.
Errorf
(
"Test %d rec
ei
ved an error of:
\n
%v"
,
i
,
err
)
}
}
}
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