update CI

This commit is contained in:
ginuerzh
2022-01-10 11:42:51 +08:00
parent 37e77bdce5
commit 0dd604a1f8
6 changed files with 56 additions and 72 deletions

View File

@ -274,7 +274,7 @@ func (h *httpHandler) authenticate(conn net.Conn, req *http.Request, resp *http.
return true
}
pr := h.md.probeResist
pr := h.md.probeResistance
// probing resistance is enabled, and knocking host is mismatch.
if pr != nil && (pr.Knock == "" || !strings.EqualFold(req.URL.Hostname(), pr.Knock)) {
resp.StatusCode = http.StatusServiceUnavailable // default status code

View File

@ -8,16 +8,16 @@ import (
)
type metadata struct {
probeResist *probeResist
sni bool
enableUDP bool
header http.Header
probeResistance *probeResistance
sni bool
enableUDP bool
header http.Header
}
func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
const (
header = "header"
probeResistKey = "probeResist"
probeResistKey = "probeResistance"
knock = "knock"
sni = "sni"
enableUDP = "udp"
@ -33,7 +33,7 @@ func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
if v := mdata.GetString(md, probeResistKey); v != "" {
if ss := strings.SplitN(v, ":", 2); len(ss) == 2 {
h.md.probeResist = &probeResist{
h.md.probeResistance = &probeResistance{
Type: ss[0],
Value: ss[1],
Knock: mdata.GetString(md, knock),
@ -46,7 +46,7 @@ func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
return nil
}
type probeResist struct {
type probeResistance struct {
Type string
Value string
Knock string