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
1
Merge Requests
1
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
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 @@
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
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() {
s
.
WriteHeader
(
http
.
StatusOK
)
}
func
(
st
*
Static
)
ErrorPages
(
en
abled
bool
,
handler
http
.
Handler
)
http
.
Handler
{
if
!
en
abled
{
func
(
st
*
Static
)
ErrorPages
Unless
(
dis
abled
bool
,
handler
http
.
Handler
)
http
.
Handler
{
if
dis
abled
{
return
handler
}
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) {
fmt
.
Fprint
(
w
,
"Not Found"
)
})
st
:=
&
Static
{
dir
}
st
.
ErrorPages
(
tru
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
st
.
ErrorPages
Unless
(
fals
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
w
.
Flush
()
testhelper
.
AssertResponseCode
(
t
,
w
,
404
)
...
...
@@ -48,7 +48,7 @@ func TestIfErrorPassedIfNoErrorPageIsFound(t *testing.T) {
fmt
.
Fprint
(
w
,
errorResponse
)
})
st
:=
&
Static
{
dir
}
st
.
ErrorPages
(
tru
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
st
.
ErrorPages
Unless
(
fals
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
w
.
Flush
()
testhelper
.
AssertResponseCode
(
t
,
w
,
404
)
...
...
@@ -72,7 +72,7 @@ func TestIfErrorPageIsIgnoredInDevelopment(t *testing.T) {
fmt
.
Fprint
(
w
,
serverError
)
})
st
:=
&
Static
{
dir
}
st
.
ErrorPages
(
fals
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
st
.
ErrorPages
Unless
(
tru
e
,
h
)
.
ServeHTTP
(
w
,
nil
)
w
.
Flush
()
testhelper
.
AssertResponseCode
(
t
,
w
,
500
)
testhelper
.
AssertResponseBody
(
t
,
w
,
serverError
)
...
...
internal/upstream/routes.go
View file @
161d1243
...
...
@@ -84,13 +84,13 @@ func (u *Upstream) configureRoutes() {
// 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
// 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
route
{
""
,
nil
,
static
.
ServeExisting
(
u
.
URLPrefix
,
staticpages
.
CacheDisabled
,
static
.
DeployPage
(
static
.
ErrorPages
(
u
.
DevelopmentMode
,
static
.
ErrorPages
Unless
(
u
.
DevelopmentMode
,
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