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
Short URL converted to lowercase when custom protocol is used #2876
Comments
First of all, thanks for taking the time to file details. Much appreciated when we can simply read an issue rather than try to understand it :) Regarding the issue itself : indeed, and this is intended behavior. The URL is not converted to lowercase -- just its "authority" part. A "URI" has various components, see Uniform_Resource_Identifier#Syntax : When the
In your example, custom://SomeText and custom://sometext should be the same, so we're lowercasing it to avoid considering same URI as different entries (eg submit http://github.com and then http://GitHub.com, it should state that the URL is already existing). In your example again, custom://this/SoMeTeXt and custom://this/sometext will be correctly stored, the part of the URI after the authority being preserved as case sensitive (SoMeTeXt and sometext) If you want to know more about how and why it works this way:
What was your actual use case ? |
Thank you for your detailed response. |
But then, if you don't know what messaging service is used, how can you craft the correct deep link ? ie whatsapp://something or messenger://something ? |
The proprietary protocol is fixed - |
Few more words on:
Writing in the address bar Is my line of thinking correct or am I missing something again? |
Since authority is case insensitive, it's much much more efficient to store lowercase once and perform operations without worrying (during searches, adding new URLs, displaying stats, etc...) , than store "as is" and perform all operations with a lowercasing overhead of the entire database everytime |
Thank you for your response ozh. Fully support the operations performance efficiency. |
The thing is, we cannot just do case insensitive search: This said, the "part of the marketing strategy" point is valid (or, more generally speaking, "the end user should be able to do whatever they want to do"). If you think there is a missing filter somewhere that would allow such user freedom (maybe at this end of this function?), feel free to submit a pull request |
Describe the bug
Short URL for custom protocols are converted to lowercase
To Reproduce
Prerequisites:
Make sure your
config.php
includes:and
Expected behavior
The resulted short URL is: https://my_short_url.domain/SomeText
The resulted original URL is: custom://SomeText
Actual behavior
The resulted short URL is: https://my_short_url.domain/SomeText
The resulted original URL is: custom://sometext
Versions
YOURLS v 1.8.1
The text was updated successfully, but these errors were encountered: