I'm using their REST API and I'm trying to get bucket location but without any success. Every time when I'm trying to do that I get the exact same error - 400 Bad Request (error code: AuthorizationHeaderMalformed). No matter what I do I get this error. When I parse the response I'm able to see that the region is there. The question is: Do we have an option to get the bucket region without getting this error? From their AWS SDK(PHP) I'm able to see that they catch the error and after that, they get the region from the response body.
* Closing connection 0
* Trying 52.218.244.186...
* TCP_NODELAY set
* Connected to servmasltest123455.s3.amazonaws.com (52.218.244.186) port 80 (#0)
> GET /?location HTTP/1.1
Host: servmasltest123455.s3.amazonaws.com
Accept: */*
User-Agent: user-agent
x-amz-date: 20190617T121859Z
x-amz-content-sha256: signature
< HTTP/1.1 400 Bad Request
< x-amz-request-id: B391493327CE3B63
< x-amz-id-2: x-amz-id
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Mon, 17 Jun 2019 12:18:59 GMT
< Connection: close
< Server: AmazonS3