Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be less restrictive on what characters are disallowed in custom slugs #2310

Merged

Conversation

acelaya
Copy link
Member

@acelaya acelaya commented Dec 17, 2024

Closes #2156

Reduce the strictness on what characters can be used in custom slugs.

At one point, a bug was reported that using ? would create invalid URLs, as the server would then detect anything after the question mark as part of the query string, and never match the short URL.

In order to prevent this, Shlink started to forbid the use of URL-reserved characters in custom slugs, but that broke the experience for users which were using some of those characters.

This PR reduces a bit the strictness, by still forbidding the use of URL-reserved characters that are used to split parts of a URI (gen-delimiters), but allowing other reserved characters (sub-delimiters) like + or &.

@acelaya acelaya force-pushed the feature/less-restrictive-custom-slugs branch from dd3d014 to e80af78 Compare December 17, 2024 17:04
@acelaya acelaya merged commit 736e09a into shlinkio:develop Dec 17, 2024
21 checks passed
@acelaya acelaya deleted the feature/less-restrictive-custom-slugs branch December 17, 2024 17:09
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.71%. Comparing base (509ef66) to head (e80af78).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2310   +/-   ##
==========================================
  Coverage      93.71%   93.71%           
  Complexity      1680     1680           
==========================================
  Files            276      276           
  Lines           5839     5839           
==========================================
  Hits            5472     5472           
  Misses           367      367           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow "&" and "+" characters in custom slugs again.
1 participant