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
161d1243
Commit
161d1243
authored
Jan 18, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into raw-blob
parents
34b2309b
3bbb1be7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
8 deletions
+14
-8
CHANGELOG
CHANGELOG
+6
-0
VERSION
VERSION
+1
-1
internal/staticpages/error_pages.go
internal/staticpages/error_pages.go
+2
-2
internal/staticpages/error_pages_test.go
internal/staticpages/error_pages_test.go
+3
-3
internal/upstream/routes.go
internal/upstream/routes.go
+2
-2
No files found.
CHANGELOG
View file @
161d1243
...
@@ -2,6 +2,12 @@
...
@@ -2,6 +2,12 @@
Formerly known as 'gitlab-git-http-server'.
Formerly known as 'gitlab-git-http-server'.
0.6.0
Overhauled the source code organization; no user-facing changes
(intended). The application code is now split into Go 'packages'
(modules).
0.5.4
0.5.4
Fix /api/v3/projects routing bug introduced in 0.5.2-0.5.3.
Fix /api/v3/projects routing bug introduced in 0.5.2-0.5.3.
...
...
VERSION
View file @
161d1243
0.
5.4
0.
6.0
internal/staticpages/error_pages.go
View file @
161d1243
...
@@ -60,8 +60,8 @@ func (s *errorPageResponseWriter) Flush() {
...
@@ -60,8 +60,8 @@ func (s *errorPageResponseWriter) Flush() {
s
.
WriteHeader
(
http
.
StatusOK
)
s
.
WriteHeader
(
http
.
StatusOK
)
}
}
func
(
st
*
Static
)
ErrorPages
(
en
abled
bool
,
handler
http
.
Handler
)
http
.
Handler
{
func
(
st
*
Static
)
ErrorPages
Unless
(
dis
abled
bool
,
handler
http
.
Handler
)
http
.
Handler
{
if
!
en
abled
{
if
dis
abled
{
return
handler
return
handler
}
}
return
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
return
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
...
...
internal/staticpages/error_pages_test.go
View file @
161d1243
...
@@ -27,7 +27,7 @@ func TestIfErrorPageIsPresented(t *testing.T) {
...
@@ -27,7 +27,7 @@ func TestIfErrorPageIsPresented(t *testing.T) {
fmt
.
Fprint
(
w
,
"Not Found"
)
fmt
.
Fprint
(
w
,
"Not Found"
)
})
})
st
:=
&
Static
{
dir
}
st
:=
&
Static
{
dir
}
st
.
ErrorPages
(
tru
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
st
.
ErrorPages
Unless
(
fals
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
w
.
Flush
()
w
.
Flush
()
testhelper
.
AssertResponseCode
(
t
,
w
,
404
)
testhelper
.
AssertResponseCode
(
t
,
w
,
404
)
...
@@ -48,7 +48,7 @@ func TestIfErrorPassedIfNoErrorPageIsFound(t *testing.T) {
...
@@ -48,7 +48,7 @@ func TestIfErrorPassedIfNoErrorPageIsFound(t *testing.T) {
fmt
.
Fprint
(
w
,
errorResponse
)
fmt
.
Fprint
(
w
,
errorResponse
)
})
})
st
:=
&
Static
{
dir
}
st
:=
&
Static
{
dir
}
st
.
ErrorPages
(
tru
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
st
.
ErrorPages
Unless
(
fals
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
w
.
Flush
()
w
.
Flush
()
testhelper
.
AssertResponseCode
(
t
,
w
,
404
)
testhelper
.
AssertResponseCode
(
t
,
w
,
404
)
...
@@ -72,7 +72,7 @@ func TestIfErrorPageIsIgnoredInDevelopment(t *testing.T) {
...
@@ -72,7 +72,7 @@ func TestIfErrorPageIsIgnoredInDevelopment(t *testing.T) {
fmt
.
Fprint
(
w
,
serverError
)
fmt
.
Fprint
(
w
,
serverError
)
})
})
st
:=
&
Static
{
dir
}
st
:=
&
Static
{
dir
}
st
.
ErrorPages
(
fals
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
st
.
ErrorPages
Unless
(
tru
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
w
.
Flush
()
w
.
Flush
()
testhelper
.
AssertResponseCode
(
t
,
w
,
500
)
testhelper
.
AssertResponseCode
(
t
,
w
,
500
)
testhelper
.
AssertResponseBody
(
t
,
w
,
serverError
)
testhelper
.
AssertResponseBody
(
t
,
w
,
serverError
)
...
...
internal/upstream/routes.go
View file @
161d1243
...
@@ -84,13 +84,13 @@ func (u *Upstream) configureRoutes() {
...
@@ -84,13 +84,13 @@ func (u *Upstream) configureRoutes() {
// To prevent anybody who knows/guesses the URL of a user-uploaded file
// To prevent anybody who knows/guesses the URL of a user-uploaded file
// from downloading it we make sure requests to /uploads/ do _not_ pass
// from downloading it we make sure requests to /uploads/ do _not_ pass
// through static.ServeExisting.
// through static.ServeExisting.
route
{
""
,
regexp
.
MustCompile
(
`^/uploads/`
),
static
.
ErrorPages
(
u
.
DevelopmentMode
,
proxy
)},
route
{
""
,
regexp
.
MustCompile
(
`^/uploads/`
),
static
.
ErrorPages
Unless
(
u
.
DevelopmentMode
,
proxy
)},
// Serve static files or forward the requests
// Serve static files or forward the requests
route
{
""
,
nil
,
route
{
""
,
nil
,
static
.
ServeExisting
(
u
.
URLPrefix
,
staticpages
.
CacheDisabled
,
static
.
ServeExisting
(
u
.
URLPrefix
,
staticpages
.
CacheDisabled
,
static
.
DeployPage
(
static
.
DeployPage
(
static
.
ErrorPages
(
u
.
DevelopmentMode
,
static
.
ErrorPages
Unless
(
u
.
DevelopmentMode
,
proxy
,
proxy
,
),
),
),
),
...
...
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