mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-06 02:48:48 +03:00
fixing ineffectual assignments
This commit is contained in:
parent
f15c59cc3d
commit
79760344e7
5 changed files with 5 additions and 5 deletions
|
@ -300,7 +300,7 @@ func TestBrowseJson(t *testing.T) {
|
|||
req.Header.Set("Accept", "application/json")
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
code, err := b.ServeHTTP(rec, req)
|
||||
code, _ := b.ServeHTTP(rec, req)
|
||||
|
||||
if code != http.StatusOK {
|
||||
t.Fatalf("In test %d: Wrong status, expected %d, got %d", i, http.StatusOK, code)
|
||||
|
|
|
@ -545,7 +545,7 @@ func (c *FCGIClient) PostFile(p map[string]string, data url.Values, file map[str
|
|||
if e != nil {
|
||||
return nil, e
|
||||
}
|
||||
_, err = io.Copy(part, fd)
|
||||
io.Copy(part, fd)
|
||||
}
|
||||
|
||||
err = writer.Close()
|
||||
|
|
|
@ -103,7 +103,7 @@ func (fs FileServer) serveFile(w http.ResponseWriter, r *http.Request, name stri
|
|||
defer ff.Close()
|
||||
dd, err := ff.Stat()
|
||||
if err == nil {
|
||||
name = index
|
||||
//name = index //ineffectual
|
||||
d = dd
|
||||
f = ff
|
||||
break
|
||||
|
|
|
@ -162,7 +162,7 @@ func TestServeHTTP(t *testing.T) {
|
|||
|
||||
for i, test := range tests {
|
||||
responseRecorder := httptest.NewRecorder()
|
||||
request, err := http.NewRequest("GET", test.url, nil)
|
||||
request, _ := http.NewRequest("GET", test.url, nil)
|
||||
// prevent any URL sanitization within Go: we need unmodified paths here
|
||||
if u, _ := url.Parse(test.url); u.RawPath != "" {
|
||||
request.URL.Path = u.RawPath
|
||||
|
|
|
@ -55,7 +55,7 @@ var newACMEClient = func(config *Config, allowPrompts bool) (*ACMEClient, error)
|
|||
if !strings.Contains(caURL, "://") {
|
||||
caURL = "https://" + caURL
|
||||
}
|
||||
u, err := url.Parse(caURL)
|
||||
u, _ := url.Parse(caURL)
|
||||
if u.Scheme != "https" && !caddy.IsLoopback(u.Host) && !strings.HasPrefix(u.Host, "10.") {
|
||||
return nil, fmt.Errorf("%s: insecure CA URL (HTTPS required)", caURL)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue