Get default location returns the location based on the input URL `u`, if region override is provided then all location defaults to regionOverride. If no other cases match then the location is set to `us-east-1` as a last resort.
(u url.URL, regionOverride string)
| 498 | // If no other cases match then the location is set to `us-east-1` |
| 499 | // as a last resort. |
| 500 | func getDefaultLocation(u url.URL, regionOverride string) (location string) { |
| 501 | if regionOverride != "" { |
| 502 | return regionOverride |
| 503 | } |
| 504 | region := s3utils.GetRegionFromURL(u) |
| 505 | if region == "" { |
| 506 | region = "us-east-1" |
| 507 | } |
| 508 | return region |
| 509 | } |
| 510 | |
| 511 | var supportedHeaders = map[string]bool{ |
| 512 | "content-type": true, |