fix http proxy response

This commit is contained in:
ginuerzh
2024-06-25 22:09:00 +08:00
parent b99292bed8
commit 74dc03bd66
2 changed files with 16 additions and 4 deletions

View File

@ -10,7 +10,8 @@ import (
)
const (
defaultRealm = "gost"
defaultRealm = "gost"
defaultProxyAgent = "gost/3.0"
)
type metadata struct {
@ -20,6 +21,7 @@ type metadata struct {
hash string
authBasicRealm string
observePeriod time.Duration
proxyAgent string
}
func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
@ -46,6 +48,11 @@ func (h *httpHandler) parseMetadata(md mdata.Metadata) error {
h.md.observePeriod = mdutil.GetDuration(md, "observePeriod")
h.md.proxyAgent = mdutil.GetString(md, "http.proxyAgent", "proxyAgent")
if h.md.proxyAgent == "" {
h.md.proxyAgent = defaultProxyAgent
}
return nil
}