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
2536ea74
Commit
2536ea74
authored
Jun 02, 2016
by
Matt Holt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #859 from jupiter/fix/issue-643
Fix for cleaned URL.Path
parents
a0e6eb3b
9acfec54
Changes
2
Hide 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 @
2536ea74
...
...
@@ -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 @
2536ea74
...
...
@@ -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