Skip to content

Commit f4bb8a6

Browse files
author
Michael Hoisie
committed
Support cookies from fastcgi properly.
1 parent ac6dde4 commit f4bb8a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

request.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ func newRequestCgi(headers map[string]string, body io.Reader) *Request {
7474
url, _ := http.ParseURL(rawurl)
7575
useragent, _ := headers["USER_AGENT"]
7676

77+
if cookie, ok := headers["HTTP_COOKIE"]; ok {
78+
httpheader["Cookie"] = cookie
79+
}
80+
7781
if method == "POST" {
7882
if ctype, ok := headers["CONTENT_TYPE"]; ok {
7983
httpheader["Content-Type"] = ctype

web.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ func (c *httpConn) Close() {
211211

212212
func httpHandler(c *http.Conn, req *http.Request) {
213213
conn := httpConn{c}
214-
215214
wreq := newRequest(req)
216-
217215
routeHandler(wreq, &conn)
218216
}
219217

0 commit comments

Comments
 (0)