🐛(backend) fix s3 version_id validation

The regex used on the version_detail endpoint path is not fully
compatible with the S3 spec. In the S3 specs, Version IDs are Unicode,
UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024
bytes long. We don't accept all unicode characters but enough to be
compliant.
This commit is contained in:
Manuel Raynaud
2025-10-30 15:29:11 +01:00
committed by GitHub
parent 2f010cf36d
commit 1c96d645ba
2 changed files with 2 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ and this project adheres to
- 🐛(backend) fix trashbin list
- ♿(frontend) improve accessibility:
- ♿(frontend) remove empty alt on logo due to Axe a11y error #1516
- 🐛(backend) fix s3 version_id validation
## [3.8.2] - 2025-10-17

View File

@@ -1105,7 +1105,7 @@ class DocumentViewSet(
@drf.decorators.action(
detail=True,
methods=["get", "delete"],
url_path="versions/(?P<version_id>[0-9a-z-]+)",
url_path=r"versions/(?P<version_id>[A-Za-z0-9._+\-=~]{1,1024})",
)
# pylint: disable=unused-argument
def versions_detail(self, request, pk, version_id, *args, **kwargs):