code: func regionFromMalformedAuthHeaderError(err error) string {
  	if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "AuthorizationHeaderMalformed" {
  		matches := malformedAuthHeaderMessageRegexp.FindStringSubmatch(aerr.Message())
  		if len(matches) == 2 {
  			return matches[1]
  		}
  		log.Printf("s3: got AuthorizationHeaderMalformed, but couldn't parse message: %v", aerr.Message())
  	}
  	return ""
  }
docs: // backwards compatibility: perkeep used to use v2 signing. v2 signing knows
  // nothing about regions, so users could configure their perkeep instance with
  // region = us-east-1, but endpoint = us-west-2.s3.amazonaws.com, and things
  // would work before.
  // In an attempt to retain that functionality, we parse the error message
  // telling us we hit the wrong region and auto-correct it.