mirror of
https://github.com/dstotijn/hetty.git
synced 2025-07-01 18:47:29 -04:00
Compare commits
1 Commits
fix/dns-re
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
d65d0bb9c4 |
@ -4022,9 +4022,9 @@ loader-runner@^4.2.0:
|
||||
integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==
|
||||
|
||||
loader-utils@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129"
|
||||
integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c"
|
||||
integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==
|
||||
dependencies:
|
||||
big.js "^5.2.2"
|
||||
emojis-list "^3.0.0"
|
||||
|
@ -221,12 +221,17 @@ func (cmd *HettyCommand) Exec(ctx context.Context, _ []string) error {
|
||||
hostname, _ := os.Hostname()
|
||||
host, _, _ := net.SplitHostPort(req.Host)
|
||||
|
||||
// Serve local admin routes when the `Host` is well-known, e.g. `[hostname]:[port]`,
|
||||
// `hetty.proxy`, `localhost:[port]` or the listen addr `[host]:[port]`.
|
||||
// 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.
|
||||
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.Host == fmt.Sprintf("%v:%v", listenHost, listenPort) ||
|
||||
req.Method != http.MethodConnect && !strings.HasPrefix(req.RequestURI, "http://")
|
||||
}).Subrouter().StrictSlash(true)
|
||||
|
||||
// GraphQL server.
|
||||
|
Reference in New Issue
Block a user