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
3f509099
Commit
3f509099
authored
Mar 09, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unecessary comments and spaces
parent
803f74c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
internal/api/api.go
internal/api/api.go
+2
-5
No files found.
internal/api/api.go
View file @
3f509099
...
...
@@ -185,8 +185,7 @@ func (api *API) PreAuthorize(suffix string, r *http.Request) (httpResponse *http
return
nil
,
nil
,
fmt
.
Errorf
(
"preAuthorizeHandler newUpstreamRequest: %v"
,
err
)
}
httpResponse
,
err
=
api
.
clientDoNotFollowRedirects
(
authReq
)
httpResponse
,
err
=
api
.
doRequestWithoutRedirects
(
authReq
)
if
err
!=
nil
{
return
nil
,
nil
,
fmt
.
Errorf
(
"preAuthorizeHandler: do request: %v"
,
err
)
}
...
...
@@ -242,13 +241,11 @@ func (api *API) PreAuthorizeHandler(next HandleFunc, suffix string) http.Handler
})
}
// go < 1.7 compatibility
func
(
api
*
API
)
clientDoNotFollowRedirects
(
authReq
*
http
.
Request
)
(
*
http
.
Response
,
error
)
{
func
(
api
*
API
)
doRequestWithoutRedirects
(
authReq
*
http
.
Request
)
(
*
http
.
Response
,
error
)
{
return
api
.
Client
.
Transport
.
RoundTrip
(
authReq
)
}
func
copyAuthHeader
(
httpResponse
*
http
.
Response
,
w
http
.
ResponseWriter
)
{
// Negotiate authentication (Kerberos) may need to return a WWW-Authenticate
// header to the client even in case of success as per RFC4559.
for
k
,
v
:=
range
httpResponse
.
Header
{
...
...
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