| |
@@ -0,0 +1,64 @@
|
| |
+ From 08bdad1864695c7c98b84f1fed6adfa07fb8da72 Mon Sep 17 00:00:00 2001
|
| |
+ From: =?UTF-8?q?V=C3=ADt=20Str=C3=A1dal?= <vit.stradal@gooddata.com>
|
| |
+ Date: Wed, 22 Mar 2023 10:03:58 +0100
|
| |
+ Subject: [PATCH] Fix `initiate_multipart_upload()` content type check
|
| |
+
|
| |
+ ---
|
| |
+ lib/Net/Amazon/S3/Client/Object.pm | 2 --
|
| |
+ lib/Net/Amazon/S3/Response.pm | 7 ++++++-
|
| |
+ t/s3-operation-object-upload-part.t | 4 ----
|
| |
+ 3 files changed, 6 insertions(+), 7 deletions(-)
|
| |
+
|
| |
+ diff --git a/lib/Net/Amazon/S3/Client/Object.pm b/lib/Net/Amazon/S3/Client/Object.pm
|
| |
+ index 22686237..1f879000 100644
|
| |
+ --- a/lib/Net/Amazon/S3/Client/Object.pm
|
| |
+ +++ b/lib/Net/Amazon/S3/Client/Object.pm
|
| |
+ @@ -344,8 +344,6 @@ sub put_part {
|
| |
+
|
| |
+ upload_id => $args{upload_id},
|
| |
+ part_number => $args{part_number},
|
| |
+ - acl_short => $args{acl_short},
|
| |
+ - copy_source => $args{copy_source},
|
| |
+ headers => $args{headers},
|
| |
+ value => $args{value},
|
| |
+ );
|
| |
+ diff --git a/lib/Net/Amazon/S3/Response.pm b/lib/Net/Amazon/S3/Response.pm
|
| |
+ index 84facb5c..89712524 100644
|
| |
+ --- a/lib/Net/Amazon/S3/Response.pm
|
| |
+ +++ b/lib/Net/Amazon/S3/Response.pm
|
| |
+ @@ -122,7 +122,12 @@ sub version_id {
|
| |
+ sub is_xml_content {
|
| |
+ my ($self) = @_;
|
| |
+
|
| |
+ - return $self->content_type =~ m:[/+]xml\b: && $self->decoded_content;
|
| |
+ + my $decoded_content = $self->decoded_content;
|
| |
+ + my $content_type = $self->content_type;
|
| |
+ +
|
| |
+ + return $content_type =~ m{[/+]xml\b} && $decoded_content if $content_type;
|
| |
+ + return 1 if $decoded_content && $decoded_content =~ /^<\?xml\b/;
|
| |
+ + return 0;
|
| |
+ }
|
| |
+
|
| |
+ sub is_error {
|
| |
+ diff --git a/t/s3-operation-object-upload-part.t b/t/s3-operation-object-upload-part.t
|
| |
+ index add5647e..6ede1c8e 100644
|
| |
+ --- a/t/s3-operation-object-upload-part.t
|
| |
+ +++ b/t/s3-operation-object-upload-part.t
|
| |
+ @@ -42,8 +42,6 @@ sub expect_operation_object_upload_part {
|
| |
+ value => 'foo-bar-baz',
|
| |
+ upload_id => 42,
|
| |
+ part_number => 1,
|
| |
+ - acl_short => 'private',
|
| |
+ - copy_source => 'source-key',
|
| |
+ headers => {
|
| |
+ x_amz_meta_additional => 'additional-header',
|
| |
+ },
|
| |
+ @@ -54,8 +52,6 @@ sub expect_operation_object_upload_part {
|
| |
+ value => 'foo-bar-baz',
|
| |
+ upload_id => 42,
|
| |
+ part_number => 1,
|
| |
+ - acl_short => 'private',
|
| |
+ - copy_source => 'source-key',
|
| |
+ headers => {
|
| |
+ x_amz_meta_additional => 'additional-header',
|
| |
+ 'Content-Length' => 11,
|
| |