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
9acfec54
Commit
9acfec54
authored
Jun 01, 2016
by
Pieter Raubenheimer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cleaned URL path in proxy
parent
a0e6eb3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
middleware/proxy/proxy.go
middleware/proxy/proxy.go
+5
-0
middleware/proxy/proxy_test.go
middleware/proxy/proxy_test.go
+2
-0
No files found.
middleware/proxy/proxy.go
View file @
9acfec54
...
...
@@ -165,6 +165,11 @@ func createUpstreamRequest(r *http.Request) *http.Request {
outreq
:=
new
(
http
.
Request
)
*
outreq
=
*
r
// includes shallow copies of maps, but okay
// Restore URL Path if it has been modified
if
outreq
.
URL
.
RawPath
!=
""
{
outreq
.
URL
.
Opaque
=
outreq
.
URL
.
RawPath
}
// Remove hop-by-hop headers to the backend. Especially
// important is "Connection" because we want a persistent
// connection, regardless of what the client sent to us. This
...
...
middleware/proxy/proxy_test.go
View file @
9acfec54
...
...
@@ -309,6 +309,8 @@ func TestUnixSocketProxyPaths(t *testing.T) {
{
"/proxy/hello"
,
"/proxy"
,
fmt
.
Sprintf
(
greeting
,
"/hello"
)},
{
"/proxy/foo/bar"
,
"/proxy"
,
fmt
.
Sprintf
(
greeting
,
"/foo/bar"
)},
{
"/proxy/?foo=bar"
,
"/proxy"
,
fmt
.
Sprintf
(
greeting
,
"/?foo=bar"
)},
{
"/queues/%2F/fetchtasks"
,
""
,
fmt
.
Sprintf
(
greeting
,
"/queues/%2F/fetchtasks"
)},
{
"/queues/%2F/fetchtasks?foo=bar"
,
""
,
fmt
.
Sprintf
(
greeting
,
"/queues/%2F/fetchtasks?foo=bar"
)},
}
for
_
,
test
:=
range
tests
{
...
...
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