-
Notifications
You must be signed in to change notification settings - Fork 91
Sinatra doesn't seem to like a trailing /
#15
Comments
There is a PR adding this to set :strict_paths, false |
see #22 |
@KrauseFx @taquitos most web services may do this but if it isn't with a 301 redirect it's creating duplicate content as they are indeed both two separate resources. That's the R and the I in URI. They MUST be unique. (Even if you redirect). If they are not must redirect or use Just because we are doing things doesn't make them sound. To be clear even Roy Fielding said Rails didn't implement REST properly and spent months in endless debates with the man. But if you asked Rails at that time it would have been said they WERE RESTful. Technically speaking until browsers support DELETE,PUT,PATCH there's no framework really restful. But I digress. An example to think about is say you have a page on Perfect example of although web servers may implement anti-patterns the web platform may implement otherwise. I've had to solve many a bug in open source from the example above. I also realize Sinatra may be shielded from this converntion with situations like static files always being served from root and url path helpers. At minimum would like to drive home the difference between the resources. Web servers may not consider them to be different. Developers may not want them to be different. The web works otherwise. The entire URI spec's merge algorithm 100% depends on the answer to "What is the last slash in the base path". Within the web platform all browsers implementevery single
https://cdivilly.wordpress.com/2014/03/11/why-trailing-slashes-on-uris-are-important/ |
That's super interesting, thanks for the comment and letting us know @snuggs 👍 As a developer, it's common to modify the URL directly - and as a result often end up with a trailing While not considering this might be 100% correct and according to the specifications, I don't see a reason why we should distinguish, considering that we'll never show different content depending on if there is a trailing |
@KrauseFx thanks man! Just some war stories. FWIW. it's not about different content. It's more about unloading developer footguns. INDEED there are many apps where people use relative urls. Some even merely render html from Sinatra which isn't a bad thing. But if one of those links somehow links to To be clear i'm not suggesting anything I just know with working on the platform specs that devs may run the code. But forget that the people run the URIs. Someone bookmarks a link to Not bringing up for-instances. This actually happened to me. #SadButTrue What do you think we should do? I'm not suggesting anything as you influence direction more than I do. I just stumbled across this searching for what is the right 405 for resources for our web components project and "Resource Variants". At minimum if a redirect is not done perhaps documentation of sorts respectively. And of course I wouldn't suggest something I'm not willing to contribute to myself. I'd just be a curmudgeon then. Open source has enough of this already. :-) Truth be told I'm just as curious as to your thoughts @KrauseFx as my own. This is collaboration yanno. :-) Happy Friday! |
@snuggs said:
I think you mean:
😄 |
Indeed @tmornini ... indeed! The link example should also have been |
@snuggs said:
¿Por que? |
is treated differently than
That's not how most web services work AFAIK, and we should strip trailing
/
The text was updated successfully, but these errors were encountered: