Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-workhorse
Commits
14cdbd60
Commit
14cdbd60
authored
Dec 18, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relax argument type of handleDeployPage
parent
208403df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
deploy_page.go
deploy_page.go
+2
-2
deploy_page_test.go
deploy_page_test.go
+4
-4
No files found.
deploy_page.go
View file @
14cdbd60
...
...
@@ -6,12 +6,12 @@ import (
"path/filepath"
)
func
handleDeployPage
(
documentRoot
*
string
,
handler
http
.
Handler
Func
)
http
.
HandlerFunc
{
func
handleDeployPage
(
documentRoot
*
string
,
handler
http
.
Handler
)
http
.
HandlerFunc
{
return
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
deployPage
:=
filepath
.
Join
(
*
documentRoot
,
"index.html"
)
data
,
err
:=
ioutil
.
ReadFile
(
deployPage
)
if
err
!=
nil
{
handler
(
w
,
r
)
handler
.
ServeHTTP
(
w
,
r
)
return
}
...
...
deploy_page_test.go
View file @
14cdbd60
...
...
@@ -19,9 +19,9 @@ func TestIfNoDeployPageExist(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
executed
:=
false
handleDeployPage
(
&
dir
,
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
handleDeployPage
(
&
dir
,
http
.
HandlerFunc
(
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
executed
=
true
})(
w
,
nil
)
})
)
(
w
,
nil
)
if
!
executed
{
t
.
Error
(
"The handler should get executed"
)
}
...
...
@@ -40,9 +40,9 @@ func TestIfDeployPageExist(t *testing.T) {
w
:=
httptest
.
NewRecorder
()
executed
:=
false
handleDeployPage
(
&
dir
,
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
handleDeployPage
(
&
dir
,
http
.
HandlerFunc
(
func
(
_
http
.
ResponseWriter
,
_
*
http
.
Request
)
{
executed
=
true
})(
w
,
nil
)
})
)
(
w
,
nil
)
if
executed
{
t
.
Error
(
"The handler should not get executed"
)
}
...
...
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