News for hackers. Stuff that matters.
Re:Heroku Fucking Console by d0m on Friday March 01, 2013 @12:17PM (#5305515)
Here's another one.. In facebook apps settings, if you enter a url ending with a "/", the error message is "The url can't end with a '/'". Can't help but think about that lazy programmer who prefered to shoot an error message rather than fixing it. The irony is that it's often way easier and faster to add a .replace() and fixing it rather than writing , testing and translating the error message.
Re:Heroku Fucking Console by slewis on Friday March 01, 2013 @12:42PM (#5305687)
http://example.com/page and http://example.com/page/ could be totally different pages... So .replace()'ing could silently cause unexpected breakage.
Re:Heroku Fucking Console by nailer on Friday March 01, 2013 @02:05PM (#5306236)
They shouldn't be. Slash normalization is pretty normal and it's ones of the first things frameworks add.
Re:Heroku Fucking Console by eob on Friday March 01, 2013 @04:11PM (#5306974)
It doesn't matter if some people do slash normalizing. It's not how the web works at the standards-level.
Re:Heroku Fucking Console by artursapek on Friday March 01, 2013 @07:35PM (#5307856)
Well, maybe everyone's unawareness of this means the standard is wrong.
Re:Heroku Fucking Console by itsnotlupus on Friday March 01, 2013 @10:12PM (#5308291)
A de facto standard? We'll have to ask the committee about that.
Re:Heroku Fucking Console by silentOpen on Friday March 01, 2013 @09:56PM (#5308255)
No.
Re:Heroku Fucking Console by jarin on Friday March 01, 2013 @03:03PM (#5306621)
However, they're probably building to the URL spec which is what they should be doing.
Re:Heroku Fucking Console by petsos on Friday March 01, 2013 @08:15PM (#5307990)
They are not allowing the trailing / anyway, so what's the difference?
Re:Heroku Fucking Console by nolok on Friday March 01, 2013 @10:41PM (#5308363)
If you type google.com you don't expect FB to replace it to bing.com without telling you.

/path and /path/ are two totally different things in the standards, just like /path and /path2. Sure in most cases with and without trailing slash gives the same page; but it's not something you can assume.

Same reason why "we don't allow https links" doesn't mean you can just drop the s.

Re:Heroku Fucking Console by TylerE on Friday March 01, 2013 @12:38PM (#5305667)
That's not a safe assumption, especially in the presence of a CMS system.

foo.com/bar and foo.com/bar/ (-> foo.com/bar/index.html) can be totally seperate URLs.

Re:Heroku Fucking Console by Goopplesoft on Friday March 01, 2013 @01:56PM (#5306168)
You're missing his point. Its a safe assumption in the case that the latter gives you an error pointing you to the former. If the latter was a blank/meaningful response that would make sense, but its not.
Re:Heroku Fucking Console by nolok on Friday March 01, 2013 @10:45PM (#5308370)
You misunderstood OP, the FB error he describe is not about hitting a url "path/" that 301 to "path" and FB not detecting it.

In the uri standards, /path and /path/ are just as different as /path and /path2.

Re:Heroku Fucking Console by mmatants on Friday March 01, 2013 @02:36PM (#5306447)
You are describing a developer-oriented UI. Silently doing an automagic .replace() on developer-entered information may cause more infuriation and (importantly) bugs than flagging it as invalid. Devs should not be left blissfully unaware of string format restrictions.