Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
cmd: use net.ErrClosed for matching returned error (#4289)
Implements #3805
M. Ángel Jimeno committed
Aug 18, 2021 at 20:58 UTC
9e333c39da785075e14d2a75887439f1887356d5
1 file changed
+2
-1
cmd/commandfuncs.go
+2
-1
@@ -19,6 +19,7 @@ import (
19
"context"
20
"crypto/rand"
21
"encoding/json"
22
+ "errors"
23
"fmt"
24
"io"
25
"io/ioutil"
@@ -119,7 +120,7 @@ func cmdStart(fl Flags) (int, error) {
120
for {
121
conn, err := ln.Accept()
122
if err != nil {
122
- if !strings.Contains(err.Error(), "use of closed network connection") {
123
+ if !errors.Is(err, net.ErrClosed) {
124
log.Println(err)
125
}
126
break