4 ms·
Dern it, http<->s. I swore I algolia'd first but must not have. Sorry! Btw, would it be a bother to suggest a tweak to the submit action's link uniqueness chec
by anonsivalley652 7y ago
Dern it, http<->s. I swore I algolia'd first but must not have. Sorry!
Btw, would it be a bother to suggest a tweak to the submit action's link uniqueness check to prevent dupe items differing only in URI scheme?
// Crunchy pseudo-LISP below
(defun flip_scheme (url)
(sed "s/^https/@ttp/;s/^http/@ttps/;s/^@/h/" url)
)
// after sanitization/normalization at the point of checking for dupe items
// instead of
// (has_url url)
(if (has_url url)
(return (redirect 301 "Moved permanently" (item_for_url url))
)
(let flipped (flip_scheme url))
(if (has_url flipped)
(return (redirect 301 "Moved permanently" (item_for_url flipped)))
)
- Wowfunhappy 7y agoThe last posting was more than a year ago, it's fine to re-post! Dang was merely providing the old thread as a reference.
- dang 7y agoAs Wowfunhappy explained, it's actually a feature not a bug that your repost made it through. This is in the FAQ: https://news.ycombinator.com/newsfaq.html https://news.ycombinator.com/newsfaq.html. I'm trying not to have to post like this every time: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=by%3Adang%20curious%20reposts&sort=byDate&type=comment https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que... ... but it's beginning to look like maybe we need to.