Hacker News new | ask | show | jobs
by sodality2 1691 days ago
Why would twitter trust the Location header and not just parse the URL given to them? This seems like a strange choice to rely on their backend lookup just to display the URL...
2 comments

Twitter follows the Location header since the purpose of that header is to redirect to another page. It's considered a good user experience to display the final page as a link preview rather than the intermediary redirect.
Because that's how HTTP redirects work. A `t.co` link is simply a 301/302 redirect to another site with a `Location` header.