From 6dd22be11dd5ae2d86d681a9dae300e1c0178f46 Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Thu, 5 Sep 2024 07:08:43 +0200 Subject: [PATCH] Adding @ to the allowed characters in paths Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- backend/internal/indexstorage/api.go | 2 +- backend/internal/providerindex/providertypes/doc_item_name.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/indexstorage/api.go b/backend/internal/indexstorage/api.go index a5dddb1a..ebd1e7e5 100644 --- a/backend/internal/indexstorage/api.go +++ b/backend/internal/indexstorage/api.go @@ -10,7 +10,7 @@ type Path string const MaxPathLength = 255 -var pathPartRe = regexp.MustCompile("^[a-zA-Z0-9_.-]+(/[a-zA-Z0-9_.-]+)*$") +var pathPartRe = regexp.MustCompile("^[a-zA-Z0-9_.@-]+(/[a-zA-Z0-9_.@-]+)*$") func (p Path) Validate() error { if len(p) > MaxPathLength { diff --git a/backend/internal/providerindex/providertypes/doc_item_name.go b/backend/internal/providerindex/providertypes/doc_item_name.go index 5b720123..644e90b4 100644 --- a/backend/internal/providerindex/providertypes/doc_item_name.go +++ b/backend/internal/providerindex/providertypes/doc_item_name.go @@ -10,7 +10,7 @@ type DocItemName string const docItemNameMaxLength = 255 -var docItemNameRe = regexp.MustCompile("^[a-zA-Z0-9 ._-]+$") +var docItemNameRe = regexp.MustCompile("^[a-zA-Z0-9 ._@-]+$") func (n DocItemName) Validate() error { if len(n) > docItemNameMaxLength || !docItemNameRe.MatchString(string(n)) {