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
55d22f4e
Commit
55d22f4e
authored
Dec 21, 2015
by
Abiola Ibrahim
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master'
parents
43020533
3f787a20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
middleware/fastcgi/fcgiclient.go
middleware/fastcgi/fcgiclient.go
+11
-2
middleware/gzip/gzip.go
middleware/gzip/gzip.go
+1
-1
No files found.
middleware/fastcgi/fcgiclient.go
View file @
55d22f4e
...
@@ -400,6 +400,15 @@ func (c *FCGIClient) Do(p map[string]string, req io.Reader) (r io.Reader, err er
...
@@ -400,6 +400,15 @@ func (c *FCGIClient) Do(p map[string]string, req io.Reader) (r io.Reader, err er
return
return
}
}
// clientCloser is a io.ReadCloser. It wraps a io.Reader with a Closer
// that closes FCGIClient connection.
type
clientCloser
struct
{
*
FCGIClient
io
.
Reader
}
func
(
f
clientCloser
)
Close
()
error
{
return
f
.
rwc
.
Close
()
}
// Request returns a HTTP Response with Header and Body
// Request returns a HTTP Response with Header and Body
// from fcgi responder
// from fcgi responder
func
(
c
*
FCGIClient
)
Request
(
p
map
[
string
]
string
,
req
io
.
Reader
)
(
resp
*
http
.
Response
,
err
error
)
{
func
(
c
*
FCGIClient
)
Request
(
p
map
[
string
]
string
,
req
io
.
Reader
)
(
resp
*
http
.
Response
,
err
error
)
{
...
@@ -439,9 +448,9 @@ func (c *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Res
...
@@ -439,9 +448,9 @@ func (c *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Res
resp
.
ContentLength
,
_
=
strconv
.
ParseInt
(
resp
.
Header
.
Get
(
"Content-Length"
),
10
,
64
)
resp
.
ContentLength
,
_
=
strconv
.
ParseInt
(
resp
.
Header
.
Get
(
"Content-Length"
),
10
,
64
)
if
chunked
(
resp
.
TransferEncoding
)
{
if
chunked
(
resp
.
TransferEncoding
)
{
resp
.
Body
=
ioutil
.
NopCloser
(
httputil
.
NewChunkedReader
(
rb
))
resp
.
Body
=
clientCloser
{
c
,
httputil
.
NewChunkedReader
(
rb
)}
}
else
{
}
else
{
resp
.
Body
=
ioutil
.
NopCloser
(
rb
)
resp
.
Body
=
clientCloser
{
c
,
ioutil
.
NopCloser
(
rb
)}
}
}
return
return
}
}
...
...
middleware/gzip/gzip.go
View file @
55d22f4e
...
@@ -114,7 +114,7 @@ type gzipResponseWriter struct {
...
@@ -114,7 +114,7 @@ type gzipResponseWriter struct {
func
(
w
*
gzipResponseWriter
)
WriteHeader
(
code
int
)
{
func
(
w
*
gzipResponseWriter
)
WriteHeader
(
code
int
)
{
w
.
Header
()
.
Del
(
"Content-Length"
)
w
.
Header
()
.
Del
(
"Content-Length"
)
w
.
Header
()
.
Set
(
"Content-Encoding"
,
"gzip"
)
w
.
Header
()
.
Set
(
"Content-Encoding"
,
"gzip"
)
w
.
Header
()
.
Set
(
"Vary"
,
"Accept-Encoding"
)
w
.
Header
()
.
Add
(
"Vary"
,
"Accept-Encoding"
)
w
.
ResponseWriter
.
WriteHeader
(
code
)
w
.
ResponseWriter
.
WriteHeader
(
code
)
w
.
statusCodeWritten
=
true
w
.
statusCodeWritten
=
true
}
}
...
...
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