mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-02 03:57:38 +03:00
Merge pull request #1228 from apernet/wip-masq-proxy-url-scheme
fix: check the URL scheme of `masquerade.proxy.url` in server config
This commit is contained in:
commit
4567713ed8
1 changed files with 3 additions and 0 deletions
|
@ -804,6 +804,9 @@ func (c *serverConfig) fillMasqHandler(hyConfig *server.Config) error {
|
|||
if err != nil {
|
||||
return configError{Field: "masquerade.proxy.url", Err: err}
|
||||
}
|
||||
if u.Scheme != "http" && u.Scheme != "https" {
|
||||
return configError{Field: "masquerade.proxy.url", Err: fmt.Errorf("unsupported protocol scheme \"%s\"", u.Scheme)}
|
||||
}
|
||||
handler = &httputil.ReverseProxy{
|
||||
Rewrite: func(r *httputil.ProxyRequest) {
|
||||
r.SetURL(u)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue