Skip to content

Commit

Permalink
Use a default value for region in case of custom APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
lmaitresym committed Oct 2, 2019
1 parent 15bf2af commit 81a042b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func serviceAndRegion(host string) (service string, region string) {

parts := strings.Split(host, ".")
if !strings.Contains(host, "amazonaws.com") {
region = os.Getenv(envRegion)
if os.Getenv(envRegion) != "" {
region = os.Getenv(envRegion)
}
service = "execute-api"
} else if len(parts) == 4 {
// Either service.region.amazonaws.com or virtual-host.region.amazonaws.com
Expand Down

0 comments on commit 81a042b

Please sign in to comment.