mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-19 09:05:41 +03:00
Merge branch 'master' of ssh://github.com/mholt/caddy
This commit is contained in:
commit
2de4950015
3 changed files with 6 additions and 5 deletions
|
@ -148,7 +148,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
|
||||||
case "HEAD":
|
case "HEAD":
|
||||||
resp, err = fcgiBackend.Head(env)
|
resp, err = fcgiBackend.Head(env)
|
||||||
case "GET":
|
case "GET":
|
||||||
resp, err = fcgiBackend.Get(env)
|
resp, err = fcgiBackend.Get(env, r.Body, contentLength)
|
||||||
case "OPTIONS":
|
case "OPTIONS":
|
||||||
resp, err = fcgiBackend.Options(env)
|
resp, err = fcgiBackend.Options(env)
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -460,12 +460,12 @@ func (c *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Res
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get issues a GET request to the fcgi responder.
|
// Get issues a GET request to the fcgi responder.
|
||||||
func (c *FCGIClient) Get(p map[string]string) (resp *http.Response, err error) {
|
func (c *FCGIClient) Get(p map[string]string, body io.Reader, l int64) (resp *http.Response, err error) {
|
||||||
|
|
||||||
p["REQUEST_METHOD"] = "GET"
|
p["REQUEST_METHOD"] = "GET"
|
||||||
p["CONTENT_LENGTH"] = "0"
|
p["CONTENT_LENGTH"] = strconv.FormatInt(l, 10)
|
||||||
|
|
||||||
return c.Request(p, nil)
|
return c.Request(p, body)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Head issues a HEAD request to the fcgi responder.
|
// Head issues a HEAD request to the fcgi responder.
|
||||||
|
|
|
@ -140,7 +140,8 @@ func sendFcgi(reqType int, fcgiParams map[string]string, data []byte, posts map[
|
||||||
}
|
}
|
||||||
resp, err = fcgi.PostForm(fcgiParams, values)
|
resp, err = fcgi.PostForm(fcgiParams, values)
|
||||||
} else {
|
} else {
|
||||||
resp, err = fcgi.Get(fcgiParams)
|
rd := bytes.NewReader(data)
|
||||||
|
resp, err = fcgi.Get(fcgiParams, rd, int64(rd.Len()))
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue