Skip to content

Commit

Permalink
Merge pull request #27704 from Ken-Sumi1019/s3-object-can-read-applic…
Browse files Browse the repository at this point in the history
…ation-xml

s3 datasource aws_s3_object can read application/xml
  • Loading branch information
YakDriver authored Feb 10, 2023
2 parents be4adb8 + 8a91481 commit 3c8bd5a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changelog/27704.txt
Original file line number Diff line number Diff line change
@@ -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`)
```
11 changes: 9 additions & 2 deletions internal/service/s3/object_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3c8bd5a

Please sign in to comment.