mirror of
https://github.com/dstotijn/hetty.git
synced 2025-07-01 18:47:29 -04:00
Compare commits
1 Commits
dependabot
...
fix/dns-re
Author | SHA1 | Date | |
---|---|---|---|
57a3527667 |
@ -5573,9 +5573,9 @@ typescript@^4.0.3:
|
||||
integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==
|
||||
|
||||
ua-parser-js@^0.7.30:
|
||||
version "0.7.33"
|
||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532"
|
||||
integrity sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==
|
||||
version "0.7.31"
|
||||
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6"
|
||||
integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==
|
||||
|
||||
unbox-primitive@^1.0.1:
|
||||
version "1.0.1"
|
||||
|
@ -221,17 +221,12 @@ func (cmd *HettyCommand) Exec(ctx context.Context, _ []string) error {
|
||||
hostname, _ := os.Hostname()
|
||||
host, _, _ := net.SplitHostPort(req.Host)
|
||||
|
||||
// Serve local admin routes when either:
|
||||
// - The `Host` is well-known, e.g. `hetty.proxy`, `localhost:[port]`
|
||||
// or the listen addr `[host]:[port]`.
|
||||
// - The request is not for TLS proxying (e.g. no `CONNECT`) and not
|
||||
// for proxying an external URL. E.g. Request-Line (RFC 7230, Section 3.1.1)
|
||||
// has no scheme.
|
||||
// Serve local admin routes when the `Host` is well-known, e.g. `[hostname]:[port]`,
|
||||
// `hetty.proxy`, `localhost:[port]` or the listen addr `[host]:[port]`.
|
||||
return strings.EqualFold(host, hostname) ||
|
||||
req.Host == "hetty.proxy" ||
|
||||
req.Host == fmt.Sprintf("%v:%v", "localhost", listenPort) ||
|
||||
req.Host == fmt.Sprintf("%v:%v", listenHost, listenPort) ||
|
||||
req.Method != http.MethodConnect && !strings.HasPrefix(req.RequestURI, "http://")
|
||||
req.Host == fmt.Sprintf("%v:%v", listenHost, listenPort)
|
||||
}).Subrouter().StrictSlash(true)
|
||||
|
||||
// GraphQL server.
|
||||
|
Reference in New Issue
Block a user