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
c981b08b
Commit
c981b08b
authored
Mar 26, 2016
by
buddhamagnet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct unused assignments
parent
7271b571
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
8 additions
and
10 deletions
+8
-10
caddy/https/https_test.go
caddy/https/https_test.go
+1
-1
caddy/setup/errors_test.go
caddy/setup/errors_test.go
+1
-1
caddy/setup/websocket.go
caddy/setup/websocket.go
+1
-1
middleware/browse/browse_test.go
middleware/browse/browse_test.go
+1
-1
middleware/commands.go
middleware/commands.go
+0
-1
middleware/context.go
middleware/context.go
+0
-1
middleware/fastcgi/fcgiclient.go
middleware/fastcgi/fcgiclient.go
+1
-1
middleware/fastcgi/fcgiclient_test.go
middleware/fastcgi/fcgiclient_test.go
+1
-1
middleware/inner/internal_test.go
middleware/inner/internal_test.go
+1
-1
middleware/markdown/metadata_test.go
middleware/markdown/metadata_test.go
+1
-1
No files found.
caddy/https/https_test.go
View file @
c981b08b
...
@@ -116,7 +116,7 @@ func TestRedirPlaintextHost(t *testing.T) {
...
@@ -116,7 +116,7 @@ func TestRedirPlaintextHost(t *testing.T) {
// browsers can infer a default port from scheme, so make sure the port
// browsers can infer a default port from scheme, so make sure the port
// doesn't get added in explicitly for default ports like 443 for https.
// doesn't get added in explicitly for default ports like 443 for https.
cfg
=
redirPlaintextHost
(
server
.
Config
{
Host
:
"example.com"
,
Port
:
"443"
})
cfg
=
redirPlaintextHost
(
server
.
Config
{
Host
:
"example.com"
,
Port
:
"443"
})
handler
,
ok
=
cfg
.
Middleware
[
0
](
nil
)
.
(
redirect
.
Redirect
)
handler
,
_
=
cfg
.
Middleware
[
0
](
nil
)
.
(
redirect
.
Redirect
)
if
actual
,
expected
:=
handler
.
Rules
[
0
]
.
To
,
"https://{host}{uri}"
;
actual
!=
expected
{
if
actual
,
expected
:=
handler
.
Rules
[
0
]
.
To
,
"https://{host}{uri}"
;
actual
!=
expected
{
t
.
Errorf
(
"(Default Port) Expected redirect rule to be to URL '%s' but is actually to '%s'"
,
expected
,
actual
)
t
.
Errorf
(
"(Default Port) Expected redirect rule to be to URL '%s' but is actually to '%s'"
,
expected
,
actual
)
}
}
...
...
caddy/setup/errors_test.go
View file @
c981b08b
...
@@ -40,7 +40,7 @@ func TestErrors(t *testing.T) {
...
@@ -40,7 +40,7 @@ func TestErrors(t *testing.T) {
if
len
(
c
.
Startup
)
==
0
{
if
len
(
c
.
Startup
)
==
0
{
t
.
Fatal
(
"Expected 1 startup function, had 0"
)
t
.
Fatal
(
"Expected 1 startup function, had 0"
)
}
}
err
=
c
.
Startup
[
0
]()
c
.
Startup
[
0
]()
if
myHandler
.
Log
==
nil
{
if
myHandler
.
Log
==
nil
{
t
.
Error
(
"Expected Log to be non-nil after startup because Debug is not enabled"
)
t
.
Error
(
"Expected Log to be non-nil after startup because Debug is not enabled"
)
}
}
...
...
caddy/setup/websocket.go
View file @
c981b08b
...
@@ -62,7 +62,7 @@ func webSocketParse(c *Controller) ([]websocket.Config, error) {
...
@@ -62,7 +62,7 @@ func webSocketParse(c *Controller) ([]websocket.Config, error) {
}
}
// Okay, check again for optional block
// Okay, check again for optional block
hadBlock
,
err
=
optionalBlock
()
_
,
err
=
optionalBlock
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
middleware/browse/browse_test.go
View file @
c981b08b
...
@@ -131,7 +131,7 @@ func TestBrowseTemplate(t *testing.T) {
...
@@ -131,7 +131,7 @@ func TestBrowseTemplate(t *testing.T) {
rec
:=
httptest
.
NewRecorder
()
rec
:=
httptest
.
NewRecorder
()
code
,
err
:=
b
.
ServeHTTP
(
rec
,
req
)
code
,
_
:=
b
.
ServeHTTP
(
rec
,
req
)
if
code
!=
http
.
StatusOK
{
if
code
!=
http
.
StatusOK
{
t
.
Fatalf
(
"Wrong status, expected %d, got %d"
,
http
.
StatusOK
,
code
)
t
.
Fatalf
(
"Wrong status, expected %d, got %d"
,
http
.
StatusOK
,
code
)
}
}
...
...
middleware/commands.go
View file @
c981b08b
...
@@ -113,7 +113,6 @@ func parseWindowsCommand(cmd string) []string {
...
@@ -113,7 +113,6 @@ func parseWindowsCommand(cmd string) []string {
if
len
(
part
)
>
0
{
if
len
(
part
)
>
0
{
parts
=
append
(
parts
,
part
)
parts
=
append
(
parts
,
part
)
part
=
""
}
}
return
parts
return
parts
...
...
middleware/context.go
View file @
c981b08b
...
@@ -153,7 +153,6 @@ func (c Context) StripHTML(s string) string {
...
@@ -153,7 +153,6 @@ func (c Context) StripHTML(s string) string {
if
inTag
{
if
inTag
{
// false start
// false start
buf
.
WriteString
(
s
[
tagStart
:
])
buf
.
WriteString
(
s
[
tagStart
:
])
inTag
=
false
}
}
return
buf
.
String
()
return
buf
.
String
()
}
}
...
...
middleware/fastcgi/fcgiclient.go
View file @
c981b08b
...
@@ -149,7 +149,7 @@ func (rec *record) read(r io.Reader) (buf []byte, err error) {
...
@@ -149,7 +149,7 @@ func (rec *record) read(r io.Reader) (buf []byte, err error) {
if
len
(
rec
.
rbuf
)
<
n
{
if
len
(
rec
.
rbuf
)
<
n
{
rec
.
rbuf
=
make
([]
byte
,
n
)
rec
.
rbuf
=
make
([]
byte
,
n
)
}
}
if
n
,
err
=
io
.
ReadFull
(
r
,
rec
.
rbuf
[
:
n
]);
err
!=
nil
{
if
_
,
err
=
io
.
ReadFull
(
r
,
rec
.
rbuf
[
:
n
]);
err
!=
nil
{
return
return
}
}
buf
=
rec
.
rbuf
[
:
int
(
rec
.
h
.
ContentLength
)]
buf
=
rec
.
rbuf
[
:
int
(
rec
.
h
.
ContentLength
)]
...
...
middleware/fastcgi/fcgiclient_test.go
View file @
c981b08b
...
@@ -149,7 +149,7 @@ func sendFcgi(reqType int, fcgiParams map[string]string, data []byte, posts map[
...
@@ -149,7 +149,7 @@ func sendFcgi(reqType int, fcgiParams map[string]string, data []byte, posts map[
}
}
defer
resp
.
Body
.
Close
()
defer
resp
.
Body
.
Close
()
content
,
err
=
ioutil
.
ReadAll
(
resp
.
Body
)
content
,
_
=
ioutil
.
ReadAll
(
resp
.
Body
)
log
.
Println
(
"c: send data length ≈"
,
length
,
string
(
content
))
log
.
Println
(
"c: send data length ≈"
,
length
,
string
(
content
))
fcgi
.
Close
()
fcgi
.
Close
()
...
...
middleware/inner/internal_test.go
View file @
c981b08b
...
@@ -37,7 +37,7 @@ func TestInternal(t *testing.T) {
...
@@ -37,7 +37,7 @@ func TestInternal(t *testing.T) {
}
}
rec
:=
httptest
.
NewRecorder
()
rec
:=
httptest
.
NewRecorder
()
code
,
err
:=
im
.
ServeHTTP
(
rec
,
req
)
code
,
_
:=
im
.
ServeHTTP
(
rec
,
req
)
if
code
!=
test
.
expectedCode
{
if
code
!=
test
.
expectedCode
{
t
.
Errorf
(
"Test %d: Expected status code %d for %s, but got %d"
,
t
.
Errorf
(
"Test %d: Expected status code %d for %s, but got %d"
,
...
...
middleware/markdown/metadata_test.go
View file @
c981b08b
...
@@ -206,7 +206,7 @@ func TestParsers(t *testing.T) {
...
@@ -206,7 +206,7 @@ func TestParsers(t *testing.T) {
}
}
// front matter but no body
// front matter but no body
if
md
,
err
=
v
.
parser
.
Parse
([]
byte
(
v
.
testData
[
4
]));
err
!=
nil
{
if
_
,
err
=
v
.
parser
.
Parse
([]
byte
(
v
.
testData
[
4
]));
err
!=
nil
{
t
.
Fatalf
(
"Unexpected error for valid metadata but no body for %v"
,
v
.
name
)
t
.
Fatalf
(
"Unexpected error for valid metadata but no body for %v"
,
v
.
name
)
}
}
}
}
...
...
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