summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/fastcgi
diff options
context:
space:
mode:
authorWilczyƄskiT <102859171+WilczynskiT@users.noreply.github.com>2022-08-04 19:17:35 +0200
committerGitHub <noreply@github.com>2022-08-04 11:17:35 -0600
commit2642bd72b7ca35b8622824fdffced2aefe1aaf11 (patch)
tree3bc73bada610bfee6377eb58d89ca18b72236966 /modules/caddyhttp/reverseproxy/fastcgi
parent17ae5acaba536e98cfa86ddcd6967801f1fa1bbe (diff)
Replace strings.Index usages with strings.Cut (#4930)
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/client.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/client.go b/modules/caddyhttp/reverseproxy/fastcgi/client.go
index 0772053..0fdcbfe 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/client.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/client.go
@@ -424,13 +424,13 @@ func (c *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Res
resp.Header = http.Header(mimeHeader)
if resp.Header.Get("Status") != "" {
- statusParts := strings.SplitN(resp.Header.Get("Status"), " ", 2)
- resp.StatusCode, err = strconv.Atoi(statusParts[0])
+ statusNumber, statusInfo, statusIsCut := strings.Cut(resp.Header.Get("Status"), " ")
+ resp.StatusCode, err = strconv.Atoi(statusNumber)
if err != nil {
return
}
- if len(statusParts) > 1 {
- resp.Status = statusParts[1]
+ if statusIsCut {
+ resp.Status = statusInfo
}
} else {