mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-08 11:58:49 +03:00
code cleanup
This commit is contained in:
parent
14b64fef43
commit
29404e34d9
1 changed files with 7 additions and 13 deletions
|
@ -375,20 +375,14 @@ func (c *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Res
|
|||
resp.Header = http.Header(mimeHeader)
|
||||
|
||||
if resp.Header.Get("Status") != "" {
|
||||
|
||||
// check if Status is long enought to split
|
||||
if strings.Count(resp.Header.Get("Status"), " ") > 0 {
|
||||
statusParts := strings.SplitN(resp.Header.Get("Status"), " ", 2)
|
||||
resp.StatusCode, err = strconv.Atoi(statusParts[0])
|
||||
resp.Status = statusParts[1]
|
||||
resp.Status = statusParts[1]
|
||||
} else {
|
||||
resp.StatusCode, err = strconv.Atoi(resp.Header.Get("Status"))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if (len(statusParts) > 0) {
|
||||
resp.Status = statusParts[1]
|
||||
}
|
||||
|
||||
} else {
|
||||
resp.StatusCode = http.StatusOK
|
||||
|
|
Loading…
Reference in a new issue