Freecodecamp: Pathnames are case sensitive

Created on 19 May 2020  路  12Comments  路  Source: freeCodeCamp/freeCodeCamp

/learn is not the same as /LEARN or /LeArN. The second two take you to user profiles, I believe they are the same user profiles. Just starting an issue about it, I haven't looked into it at all.

help wanted api client bug

Most helpful comment

We will not be using /u/username pattern, there are a lot of backlinks that will be broken.

We also reserve the right to claim a path for our use as needed. Its on the user's part to NOT choose that is something unconventional.

Practically why would you choose a username 'LEARN'?

We have claimed paths in the past, by sending a notification to users for the change.

That said, this is a valid issue, we should add a middleware to make paths case-insentive. I am not sure yet, but this would mean the change can be at the client level as well, in addition to the API separately.

All 12 comments

Steps to reproduce, please?

Should pathnames be case sensitive? Is what you are saying that all routes /learn, /LEARN, /LeArN, should all take you to the same path?

@moT01 As per what I was able to find on StackOverflow, Case-sensitive URLs are a web-standard and GitHub does not allow any changes so, yes, there will be different web addresses if you type it differently.

While using different cases does change the request, it's up to the server which page it sends back. For example, this issue can be reached by going to https://github.com/freecodecamp/freecodecamp/issues/38850 as well as https://github.com/FREECODECAMP/freecodecamp/issues/38850.

The problem is that, as Tom said, someone has a variant of /LEARN as their username. They would need to be told if we were going to change it. I think this has happened before, though, when someone had 404 as their username.

I totally agree that this is a problem in progress, but we don't know when we might add a link or something that clashes with another user in the future. I think changing the format to freecodecamp.org/u/username is a way to future proof against these problems.
cc: @raisedadead

@thecodingaviator if we can do that, it would simplify the client code and cut down on the number of unavoidable 404s. Mrugesh will know if there's a reason not to beyond "it'll be a complicated rewrite".

We will not be using /u/username pattern, there are a lot of backlinks that will be broken.

We also reserve the right to claim a path for our use as needed. Its on the user's part to NOT choose that is something unconventional.

Practically why would you choose a username 'LEARN'?

We have claimed paths in the past, by sending a notification to users for the change.

That said, this is a valid issue, we should add a middleware to make paths case-insentive. I am not sure yet, but this would mean the change can be at the client level as well, in addition to the API separately.

I think solution to this problem can be , before hitting the end point the path name should be converted to appropriate format . i.e if the path should always be in lower case then before hitting the end point convert the path name to lower case and then hit the corresponding end point

Hi @ruchivora that sounds reasonable. If you've got time, a PR would be very welcome.

Yes ,The path name is case sensitive ,although it should work fine in localhost , but if you deploy to some hosting site ,it will generate an internal server error.

Is this issue still requiring help? Would like to work on this.

Hey @godslayer201, yes, this is still open. If you want to work on it, that would be great.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ar5had picture ar5had  路  3Comments

jurijuri picture jurijuri  路  3Comments

vaibsharma picture vaibsharma  路  3Comments

SaintPeter picture SaintPeter  路  3Comments

bagrounds picture bagrounds  路  3Comments