From ff7a2df1cdf3d4d7147623920bfb5e7341fdc5d5 Mon Sep 17 00:00:00 2001 From: Ken-Sumi1019 Date: Wed, 9 Nov 2022 05:50:03 +0900 Subject: [PATCH 1/4] datasource aws_s3_object can read application/xml --- internal/service/s3/object_data_source.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/s3/object_data_source.go b/internal/service/s3/object_data_source.go index d98df94fa678..fa57ac70ef16 100644 --- a/internal/service/s3/object_data_source.go +++ b/internal/service/s3/object_data_source.go @@ -258,6 +258,7 @@ func isContentTypeAllowed(contentType *string) bool { allowedContentTypes := []*regexp.Regexp{ regexp.MustCompile("^text/.+"), regexp.MustCompile("^application/json$"), + regexp.MustCompile("^application/xml$"), } for _, r := range allowedContentTypes { From 1fa3b4408c8b6fd640bcdeba76717c3a46fdab20 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 10 Feb 2023 18:09:48 -0500 Subject: [PATCH 2/4] Add human-readable application content types --- internal/service/s3/object_data_source.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/service/s3/object_data_source.go b/internal/service/s3/object_data_source.go index fa57ac70ef16..a37b6a0a509e 100644 --- a/internal/service/s3/object_data_source.go +++ b/internal/service/s3/object_data_source.go @@ -256,9 +256,15 @@ func isContentTypeAllowed(contentType *string) bool { } allowedContentTypes := []*regexp.Regexp{ - regexp.MustCompile("^text/.+"), - regexp.MustCompile("^application/json$"), - regexp.MustCompile("^application/xml$"), + regexp.MustCompile(`^application/atom\+xml$`), + regexp.MustCompile(`^application/json$`), + regexp.MustCompile(`^application/ld\+json$`), + regexp.MustCompile(`^application/x-csh$`), + regexp.MustCompile(`^application/x-httpd-php$`), + regexp.MustCompile(`^application/x-sh$`), + regexp.MustCompile(`^application/xhtml\+xml$`), + regexp.MustCompile(`^application/xml$`), + regexp.MustCompile(`^text/.+`), } for _, r := range allowedContentTypes { From dd3c9c2ca28294085638d70fc76e93461dfb65c0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 10 Feb 2023 18:20:12 -0500 Subject: [PATCH 3/4] Add changelog --- .changelog/27704.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/27704.txt diff --git a/.changelog/27704.txt b/.changelog/27704.txt new file mode 100644 index 000000000000..c46974a73d93 --- /dev/null +++ b/.changelog/27704.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +data-source/aws_s3_object: Expand content types that can be read from S3 to some human-readable application types (e.g., `application/xml`, `application/atom+xml`) +``` + +```release-note:enhancement +data-source/aws_s3_bucket_object: Expand content types that can be read from S3 to some human-readable application types (e.g., `application/xml`, `application/atom+xml`) +``` \ No newline at end of file From 8a91481084e73df62ec2e571cd4267ccfaa9a625 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 10 Feb 2023 18:21:15 -0500 Subject: [PATCH 4/4] Add changelog --- .changelog/27704.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changelog/27704.txt b/.changelog/27704.txt index c46974a73d93..6075653b3452 100644 --- a/.changelog/27704.txt +++ b/.changelog/27704.txt @@ -1,7 +1,7 @@ ```release-note:enhancement -data-source/aws_s3_object: Expand content types that can be read from S3 to some human-readable application types (e.g., `application/xml`, `application/atom+xml`) +data-source/aws_s3_object: Expand content types that can be read from S3 to include some human-readable application types (e.g., `application/xml`, `application/atom+xml`) ``` ```release-note:enhancement -data-source/aws_s3_bucket_object: Expand content types that can be read from S3 to some human-readable application types (e.g., `application/xml`, `application/atom+xml`) +data-source/aws_s3_bucket_object: Expand content types that can be read from S3 to include some human-readable application types (e.g., `application/xml`, `application/atom+xml`) ``` \ No newline at end of file