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
a1dd6f0b
Commit
a1dd6f0b
authored
Oct 24, 2016
by
Tw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proxy: set request's body to nil explicitly
fix issue #1206 Signed-off-by:
Tw
<
tw19881113@gmail.com
>
parent
3c1957a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
caddyhttp/proxy/proxy.go
caddyhttp/proxy/proxy.go
+5
-0
No files found.
caddyhttp/proxy/proxy.go
View file @
a1dd6f0b
...
...
@@ -218,6 +218,11 @@ func (p Proxy) match(r *http.Request) Upstream {
func
createUpstreamRequest
(
r
*
http
.
Request
)
*
http
.
Request
{
outreq
:=
new
(
http
.
Request
)
*
outreq
=
*
r
// includes shallow copies of maps, but okay
// We should set body to nil explicitly if request body is empty.
// For server requests the Request Body is always non-nil.
if
r
.
ContentLength
==
0
{
outreq
.
Body
=
nil
}
// Restore URL Path if it has been modified
if
outreq
.
URL
.
RawPath
!=
""
{
...
...
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