Skip to content

Commit

Permalink
fix: Respect STORAGE_EMULATOR_HOST in signedURL
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBr committed Jan 29, 2022
1 parent bf04c85 commit e9ba020
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ type bucketBoundHostname struct {
}

func (s pathStyle) host(bucket string) string {
return "storage.googleapis.com"
if os.Getenv("STORAGE_EMULATOR_HOST") {
return os.Getenv("STORAGE_EMULATOR_HOST")
} else {
return "storage.googleapis.com"
}
}

func (s virtualHostedStyle) host(bucket string) string {
Expand Down

0 comments on commit e9ba020

Please sign in to comment.