diff --git a/gems/aws-sdk-s3/lib/aws-sdk-s3/plugins/http_200_errors.rb b/gems/aws-sdk-s3/lib/aws-sdk-s3/plugins/http_200_errors.rb index 605d3359c07..84ea5ca21f3 100644 --- a/gems/aws-sdk-s3/lib/aws-sdk-s3/plugins/http_200_errors.rb +++ b/gems/aws-sdk-s3/lib/aws-sdk-s3/plugins/http_200_errors.rb @@ -42,7 +42,7 @@ def members_in_body?(output) def check_for_error(context) xml = context.http_response.body_contents - if xml.match(/\?>\n/) + if xml.match(/\?>\s*/) error_code = xml.match(/(.+?)<\/Code>/)[1] error_message = xml.match(/(.+?)<\/Message>/)[1] S3::Errors.error_class(error_code).new(context, error_message)