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

Allow for Colon (":") in Source URI Path #102

Open
marco-wildermuth opened this issue Oct 11, 2024 · 1 comment
Open

Allow for Colon (":") in Source URI Path #102

marco-wildermuth opened this issue Oct 11, 2024 · 1 comment

Comments

@marco-wildermuth
Copy link

Greetings!

When trying to add a source URI path containing a colon (:) through the backend module the validation fails, because it is not allowed in the regex /^[a-z0-9_\-\/\.%]+$/i.
It is possible to do it via commands:

./flow redirect:add --source 'category/subject:mysubject' --target 'category/subject:othersubject'

Although the colon is used in URIs for the protocol (like https://) or the port (like :80), it appears to be fine for usage in the URI path.

Related: In #101 it was proposed to have the regex only in one place, not two.

Thank you.

@Sebobo
Copy link
Member

Sebobo commented Oct 11, 2024

Hi thx for your issue.
The validation was intended to be a bit more strict. But you can override it in your own settings and allow the colons.
I personally never encountered urls with colons and there are some specific rules where they can occur see https://www.rfc-editor.org/rfc/rfc3986#section-3.3

Technically it was necessary to have two regex, as they are differently defined for JavaScript and PHP. We only found out some days ago, that there is a JS api to do server side validation and show it like other validations in the browser. This way we can keep the PHP regex and drop the js variant.

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

No branches or pull requests

2 participants