4 ms·
The problem is you can't trust it: people can modify that part of the URL arbitrarily and so you think the URL has meaning, but it doesn't.
by saurik 3y ago
The problem is you can't trust it: people can modify that part of the URL arbitrarily and so you think the URL has meaning, but it doesn't.
- kevincox 3y agoIt depends how it is implemented. After extracting the ID and looking up the post you can then check that the "slug" matches. Return a 404 if it doesn't. This may add a bit of complexity (if the slug data is mutable you need to allow any past versions or freeze it in creation) but isn't too hard if this is the approach that you want to take.
- saurik 3y agoOk, but we don't have to talk about this "depends" idea: that's not how reddit did it and I thought we were talking about reddit ;P.
- antifa 3y agoI'd still rather be saved from a bad click 99% of the time, rather than the 0% of the time an unlabeled ID link will give you.
- saurik 3y agoFWIW there was a good discussion of this on r/admin last month. https://www.reddit.com/r/admin/comments/1c6lp0z/link_slug_policy_updates/ https://www.reddit.com/r/admin/comments/1c6lp0z/link_slug_po...