Be a bit more clever when parsing S3 endpoints