// Otherwise, re-adjust the signer region in order to
// account for endpoint change after a 307 redirect
try {
if (signer instanceof RegionAwareSigner) {
((RegionAwareSigner) signer).setRegionName(
new AmazonS3URI(uri).getRegion());
}
} catch (RuntimeException e) {
log.warn("Failed to parse the endpoint " + uri +
", and skip re-signing the signer region", e);
}