Skip to content

Commit 0918c32

Browse files
committed
101 status code block
1 parent 1d16221 commit 0918c32

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/requests/request.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"crypto/tls"
66
"errors"
7+
"fmt"
78
"github.com/bufsnake/httpx/config"
89
"github.com/bufsnake/httpx/pkg/log"
910
"github.com/bufsnake/httpx/pkg/useragent"
@@ -92,6 +93,9 @@ func (r *request) Run() error {
9293
return err
9394
}
9495
defer do.Body.Close()
96+
if do.StatusCode == 101 {
97+
return fmt.Errorf("%s status is %s", req.URL, do.Status)
98+
}
9599
resp, err := httputil.DumpResponse(do, true)
96100
if err != nil {
97101
return err

0 commit comments

Comments
 (0)