News for hackers. Stuff that matters.
Re:Twitter is being investigated over data collection in its... by LeoPanthera on Sunday October 14, 2018 @06:38PM (#18215941)
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

  <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.
Re:Twitter is being investigated over data collection in its... by eli on Sunday October 14, 2018 @07:26PM (#18216205)
I 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.
Re:Twitter is being investigated over data collection in its... by pdkl95 on Sunday October 14, 2018 @08:20PM (#18216456)
They 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.

Re:Twitter is being investigated over data collection in its... by tdb7893 on Monday October 15, 2018 @02:14PM (#18222144)
Couldn'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
Re:Twitter is being investigated over data collection in its... by stingraycharles on Monday October 15, 2018 @02:10AM (#18217739)
As 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.
Re:Twitter is being investigated over data collection in its... by Leace on Monday October 15, 2018 @03:45AM (#18218079)
Of course for that there is also a standard-compliant way: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Re...
Re:Twitter is being investigated over data collection in its... by sebazzz on Monday October 15, 2018 @07:37AM (#18218895)
That doesn't work for a part of Twitter audience, among Edge users.
Re:Twitter is being investigated over data collection in its... by teraflop on Sunday October 14, 2018 @07:32PM (#18216236)
A normal HTTP redirect would accomplish the same thing.
Re:Twitter is being investigated over data collection in its... by mvanbaak on Monday October 15, 2018 @06:11AM (#18218571)
if 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

Re:Twitter is being investigated over data collection in its... by xxs on Sunday October 14, 2018 @07:20PM (#18216171)
location.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.

Re:Twitter is being investigated over data collection in its... by ceejayoz on Sunday October 14, 2018 @08:14PM (#18216428)
> location.replace removes the back button interaction, i.e. history.

A 301/302 redirect works just fine for this.

Re:Twitter is being investigated over data collection in its... by TeMPOraL on Monday October 15, 2018 @01:54AM (#18217684)
Yup. 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).