change error to code

This commit is contained in:
ginuerzh 2018-11-17 23:06:24 +08:00
parent 8ba90995ae
commit e9b872c4cf
2 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ func (h *httpHandler) handleRequest(conn net.Conn, req *http.Request) {
// probing resistance is enabled // probing resistance is enabled
if ss := strings.SplitN(h.options.ProbeResist, ":", 2); len(ss) == 2 { if ss := strings.SplitN(h.options.ProbeResist, ":", 2); len(ss) == 2 {
switch ss[0] { switch ss[0] {
case "error": case "code":
resp.StatusCode, _ = strconv.Atoi(ss[1]) resp.StatusCode, _ = strconv.Atoi(ss[1])
case "web": case "web":
url := ss[1] url := ss[1]

View File

@ -327,7 +327,7 @@ func (h *http2Handler) roundTrip(w http.ResponseWriter, r *http.Request) {
// probing resistance is enabled // probing resistance is enabled
if ss := strings.SplitN(h.options.ProbeResist, ":", 2); len(ss) == 2 { if ss := strings.SplitN(h.options.ProbeResist, ":", 2); len(ss) == 2 {
switch ss[0] { switch ss[0] {
case "error": case "code":
resp.StatusCode, _ = strconv.Atoi(ss[1]) resp.StatusCode, _ = strconv.Atoi(ss[1])
case "web": case "web":
url := ss[1] url := ss[1]