Skip to content

Commit

Permalink
URNs containing whitespaces will now be considered invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurswag committed May 17, 2024
1 parent 50a231f commit dad0c36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/library/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

logger = structlog.get_logger(__name__)

URN_REGEX = r"^urn:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)(?::([a-zA-Z0-9_-]+))?:(.+)$"
URN_REGEX = r"^urn:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)(?::([a-zA-Z0-9_-]+))?:(\S+)$"


def match_urn(urn_string):
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const UUID_REGEX = '([0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4
export const UUID_LIST_REGEX = new RegExp(`^${UUID_REGEX}(,${UUID_REGEX})*$`);

export const URN_REGEX =
/^urn:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)(?::([a-zA-Z0-9_-]+))?:(.+)$/;
/^urn:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)(?::([a-zA-Z0-9_-]+))?:(\S+)$/;

export const LOCALE_DISPLAY_MAP = {
en: '🇬🇧 English',
Expand Down

0 comments on commit dad0c36

Please sign in to comment.