Skip to content

Commit 238914d

Browse files
committed
Some misc. cleanup
The fastcgi changes came from v1 which don't make sense in v2. Fix comment about default value in reverse proxy keep alive.
1 parent e8ae80a commit 238914d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,7 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
236236
// original URI in as the value of REQUEST_URI (the user can overwrite this
237237
// if desired). Most PHP apps seem to want the original URI. Besides, this is
238238
// how nginx defaults: http://stackoverflow.com/a/12485156/1048862
239-
origReq, ok := r.Context().Value(caddyhttp.OriginalRequestCtxKey).(http.Request)
240-
if !ok {
241-
// some requests, like active health checks, don't add this to
242-
// the request context, so we can just use the current URL
243-
origReq = *r
244-
}
245-
reqURL := origReq.URL
239+
origReq := r.Context().Value(caddyhttp.OriginalRequestCtxKey).(http.Request)
246240

247241
requestScheme := "http"
248242
if r.TLS != nil {
@@ -285,7 +279,7 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
285279
"DOCUMENT_ROOT": root,
286280
"DOCUMENT_URI": docURI,
287281
"HTTP_HOST": r.Host, // added here, since not always part of headers
288-
"REQUEST_URI": reqURL.RequestURI(),
282+
"REQUEST_URI": origReq.URL.RequestURI(),
289283
"SCRIPT_FILENAME": scriptFilename,
290284
"SCRIPT_NAME": scriptName,
291285
}

modules/caddyhttp/reverseproxy/httptransport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ type KeepAlive struct {
411411
// Maximum number of idle connections. Default: 0, which means no limit.
412412
MaxIdleConns int `json:"max_idle_conns,omitempty"`
413413

414-
// Maximum number of idle connections per host. Default: 0, which uses Go's default of 2.
414+
// Maximum number of idle connections per host. Default: 32.
415415
MaxIdleConnsPerHost int `json:"max_idle_conns_per_host,omitempty"`
416416

417417
// How long connections should be kept alive when idle. Default: 0, which means no timeout.

0 commit comments

Comments
 (0)