diff --git a/.changelog/27704.txt b/.changelog/27704.txt new file mode 100644 index 000000000000..6075653b3452 --- /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 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 include some human-readable application types (e.g., `application/xml`, `application/atom+xml`) +``` \ No newline at end of file diff --git a/internal/service/s3/object_data_source.go b/internal/service/s3/object_data_source.go index d98df94fa678..a37b6a0a509e 100644 --- a/internal/service/s3/object_data_source.go +++ b/internal/service/s3/object_data_source.go @@ -256,8 +256,15 @@ func isContentTypeAllowed(contentType *string) bool { } allowedContentTypes := []*regexp.Regexp{ - regexp.MustCompile("^text/.+"), - regexp.MustCompile("^application/json$"), + 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 {