From b990e28b9aa86917ecff0205399c00d0892ed0ef Mon Sep 17 00:00:00 2001 From: Stijn Caerts Date: Mon, 27 May 2024 10:14:21 +0200 Subject: [PATCH 1/4] feat: allow content types text/xml and application/xml to be used interchangeably --- src/stac_asset/validate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stac_asset/validate.py b/src/stac_asset/validate.py index ee4089d..cfa41b6 100644 --- a/src/stac_asset/validate.py +++ b/src/stac_asset/validate.py @@ -1,7 +1,8 @@ from .errors import ContentTypeError ALLOWABLE_PAIRS = [ - ("image/tiff", "image/tiff; application=geotiff; profile=cloud-optimized") + ("image/tiff", "image/tiff; application=geotiff; profile=cloud-optimized"), + ("text/xml", "application/xml"), ] IGNORED_CONTENT_TYPES = ["binary/octet-stream", "application/octet-stream"] From 8bc699a88a716e6512ae96c22084629646e55a1c Mon Sep 17 00:00:00 2001 From: Stijn Caerts Date: Mon, 27 May 2024 10:30:47 +0200 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e11684c..d7c649c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - `download_file` ([#122](https://github.com/stac-utils/stac-asset/pull/172)) +- content type validation rule for `text/xml` and `application/xml` ([#173](https://github.com/stac-utils/stac-asset/pull/173)) ## [0.3.2] - 2024-05-20 From ff2946ae5f31c2e93533e19553e0bc0dd6b8590c Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 28 May 2024 07:40:19 -0600 Subject: [PATCH 3/4] fix: add test --- tests/test_validate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_validate.py b/tests/test_validate.py index 570f741..7b25a9f 100644 --- a/tests/test_validate.py +++ b/tests/test_validate.py @@ -12,5 +12,7 @@ def test_content_type() -> None: validate.content_type( "image/tiff; application=geotiff; profile=cloud-optimized", "image/tiff" ) + validate.content_type("text/xml", "application/xml") + validate.content_type("application/xml", "text/xml") validate.content_type("binary/octet-stream", "doesn't matter") validate.content_type("application/octet-stream", "doesn't matter") From 9e69d79e40ceac78d10d8ca2edde4cf70477e3ff Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 28 May 2024 07:41:26 -0600 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7c649c..af611d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - `download_file` ([#122](https://github.com/stac-utils/stac-asset/pull/172)) -- content type validation rule for `text/xml` and `application/xml` ([#173](https://github.com/stac-utils/stac-asset/pull/173)) +- allow `text/xml` and `application/xml` to be used interchangeably ([#173](https://github.com/stac-utils/stac-asset/pull/173)) ## [0.3.2] - 2024-05-20