Skip to content

Commit

Permalink
Fix regex for AWS sub-subdomains #62
Browse files Browse the repository at this point in the history
  • Loading branch information
iann0036 committed Feb 23, 2023
1 parent d066b82 commit 56a5487
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iamlivecore/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func createProxy(addr string) {
proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { // TODO: Move to onResponse for HTTP response codes
body, _ := ioutil.ReadAll(req.Body)

isAWSHostname, _ := regexp.MatchString(`^.*\.amazonaws\.com(?:\.cn)?$`, req.Host)
isAWSHostname, _ := regexp.MatchString(`^[^.]*\.amazonaws\.com(?:\.cn)?$`, req.Host)
if isAWSHostname {
handleAWSRequest(req, body, 200)
}
Expand Down

0 comments on commit 56a5487

Please sign in to comment.