4 ms·
You are correct: $ curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15" https://t.co/8
by LeoPanthera 8y ago
You are correct:
$ curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15" https://t.co/88MpPkUoJg https://t.co/88MpPkUoJg
<head><noscript><META http-equiv="refresh" content="0;URL=https://bbc.in/2yDY0F5"></noscript><title>https://bbc.in/2yDY0F5</title></head><script>window.opener = null; location.replace("https:\/\/bbc.in\/2yDY0F5")</script>
I had no idea they were doing it that way. How gross.
- xxs 8y agolocation.replace removes the back button interaction, i.e. history. I have always preferred to use it (location.replace) within the same site. Also it allows to better control browser cache policies. Although it has been almost a decade since, I doubt much has changed.
- ceejayoz 8y ago> location.replace removes the back button interaction, i.e. history. A 301/302 redirect works just fine for this.
- TeMPOraL 8y agoYup. The RFC is literally full of phrases like "status code indicates that the target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs. Clients with link-editing capabilities ought to automatically re-link references to the effective request URI to one or more of the new references sent by the server, where possible." (emphasis mine).
- eli 8y agoI assume it’s to remove the t.co page from the browser history, which of course is not relevant or useful for curl. There’s nothing in that response that looks malicious.
- teraflop 8y agoA normal HTTP redirect would accomplish the same thing.
- pdkl95 8y agoThey already return different results based on the user agent header; they could easily be returning different results based on other HTTP headers, IP headers, etc. Arguments that implicitly assume everyone receives the same data from a server are frighteningly common. This is extra strange when it happens on forums like HN that also regularly assume the same server might be A/B testing or providing "targeted" advertising - or prices - that is unique for most users. Any discussion about data from an unknown server should always include some sort of checksum. Without verification everyone is receiving the same data, statements about a server's responses don't mean much.
- tdb7893 8y agoCouldn't any site be sending different results based on any header? I guess I don't get how "they could easily be returning different results based on other HTTP headers, IP headers, etc" doesn't apply to literally every site
- stingraycharles 8y agoAs others have pointed out, the same thing can be accomplished using a http redirect. The only purpose this kind of intermediate page has is to hide the HTTP Referer field and make it look like it was coming from t.co. This ensures that only Twitter knows which tweet someone was coming from.
- mvanbaak 8y agoif you enable '-v' you can see they set a cookie: set-cookie: muc=4673c8f0-5aef-45eb-8e4b-ab06bc59944c; Expires=Wed, 14 Oct 2020 10:10:19 GMT; Domain=t.co