cheat.sh icon indicating copy to clipboard operation
cheat.sh copied to clipboard

URL should be case insensitive

Open neilhwatson opened this issue 7 years ago • 5 comments
trafficstars

cheat.sh/perl/subroutines

and

cheat.sh/Perl/Subroutines

Should return the same thing.

neilhwatson avatar Nov 24 '17 15:11 neilhwatson

@chubin Still actual.

steils avatar Jun 06 '21 22:06 steils

https://cheat.sh/Perl/Subroutines now gives Internal Server Error. @chubin something is broken.

abitrolly avatar Nov 13 '21 17:11 abitrolly

@abitrolly Should work now, but the issue is still actual. I agree with the proposal. The queries should be case-insensitive

chubin avatar Apr 17 '22 12:04 chubin

The fix is to add query = query.lower() somewhere around these lines.

https://github.com/chubin/cheat.sh/blob/7f769d6f3697541e55fd3ea9b71f190296529e48/lib/cheat_wrapper.py#L90-L91

Or maybe after the query is parsed if search_options are still case-sensitive at this point.

abitrolly avatar Apr 18 '22 08:04 abitrolly

Yes, but this change is not enough, because filenames are case insensitive. It is possible to make them lower case in our repositories, but we can't influence external repositories, so more changes needed, but it is not a problem

chubin avatar Apr 18 '22 18:04 chubin