removing trailing slash breaks url #4

Closed
mmb opened this Issue Sep 9, 2011 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

mmb commented Sep 9, 2011

irb(main):002:0> PostRank::URI.clean('http://www.gliffy.com/publish/2886461/')
=> "http://www.gliffy.com/publish/2886461"

http://www.gliffy.com/publish/2886461/ works fine
http://www.gliffy.com/publish/2886461 returns 404

Granted that they should fix their site but what is postrank-uri's stance on this?

Owner

igrigorik commented Sep 10, 2011

This is "intentional" on our part. We recognize that removing the trailing slash may break some sites (in our own research, its in <5%), but we need to be aggressive to generate clean ID's. As such, our rule currently is to always remove the slash. So, the behavior is as designed.

If you're using the gem and need / want to disable the trailing slash logic, in theory that could be exposed via some optional configuration parameters.

Contributor

mmb commented Sep 16, 2011

I have a need for it and I am currently redefining PostRank::URI.normalize.

I'll send a pull request for an option if you want but I understand if you want to keep the code focused on your normal use cases.

igrigorik closed this Feb 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment