News for hackers. Stuff that matters.
Re:User Agent Changes by cowmoo728 on Thursday December 12, 2019 @07:40PM (#21778116)
Can we take a moment to appreciate how obtuse UA strings are? I mean really, the user agent

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.99 Safari/537.36 Vivaldi/2.9.1705.41

is almost laughable for a strange collection of historical reasons. The history of UA strings has come up before here:

https://news.ycombinator.com/item?id=16525559

When is a browser going to just ditch the cruft and present something sensible?

Re:User Agent Changes by JoshTriplett on Thursday December 12, 2019 @08:39PM (#21778386)
I wonder if it'd be too late for http/3 to say "user-agent is deprecated, user-agents should not send it, any server accepting http/3 may assume the following compatibility value for the header without it being sent".

Was anything like that considered during the http/3 design process?

(I saw the linked "client hints" proposal in the article, but that doesn't mention the idea of completely dropping the header from client requests and assuming a certain baseline value for http/3.)

Re:User Agent Changes by toast0 on Thursday December 12, 2019 @09:12PM (#21778585)
User-Agent for browsers is pretty much useless now, but it's still a pretty useful name for a header if you want to put real information in it. Ex, if you're calling an api, it's nice to have a version number and a name/contact so broken things can be fixed.

I don't remember if HTTP/2 (and presumably /3) has a initial dictionary for header compression, they could have a suggested value in there, so if you want to look like a browser, you can use that at a low byte cost.

Re:User Agent Changes by edoceo on Thursday December 12, 2019 @09:27PM (#21778664)
I make an API, for narrow use case. All calls have to be from a registered UA, among other things forms the HMAC sig.
Re:User Agent Changes by sk5t on Thursday December 12, 2019 @09:44PM (#21778730)
You have created a perverse-sounding design.
Re:User Agent Changes by neikos on Friday December 13, 2019 @02:32AM (#21779790)
This sounds like authentication with extra steps? Why not just send a bearer token?
Re:User Agent Changes by edoceo on Friday December 13, 2019 @08:00AM (#21781141)
We do. Header is for message signing. And UA has to be registered, part of the spec provided by client.
Re:User Agent Changes by denormalfloat on Friday December 13, 2019 @01:38AM (#21779596)
This would not work, too many websites (perhaps wrongly) depend on this string.
Re:User Agent Changes by JoshTriplett on Friday December 13, 2019 @01:45AM (#21779622)
I'm specifically suggesting that http/3 could have an implied value for this header if not supplied, so that omitting it was semantically equivalent (and a server could synthesize it).
Re:User Agent Changes by denormalfloat on Sunday December 22, 2019 @09:57PM (#21861192)
That's not how HTTP works. HTTP is a transfer protocol, and is not so opinionated on the semantic meaning of the Data it moves. HTTP, HTTP/2, and HTTP/3 were designed to be backwards compatible. It would break that compatibility if there were a semantic change in the absence of the UA string. Specifically, H/3 requests couldn't be downgraded to HTTP/1.1 requests by proxies. There are a lot of proxies.
Re:User Agent Changes by JoshTriplett on Tuesday December 24, 2019 @08:52PM (#21876197)
> It would break that compatibility if there were a semantic change in the absence of the UA string. Specifically, H/3 requests couldn't be downgraded to HTTP/1.1 requests by proxies.

It would not reduce the semantic meaning of HTTP to say "in http/3, the default value of the user-agent header is XYZ (a non-specific modern browser), and if you want an empty header, you must specify the header with an empty value. Proxies and other software translating requests between http/3 and older versions of http should map an omitted header in http/3 to this value, and should map an empty string to a missing header."

It would certainly require change, and it isn't a change likely to happen at this point, but it wouldn't have been impossible, nor would it have reduced the fidelity of http. It simply would have changed the default assumption from "something too ancient to identify itself" to "something modern that doesn't want to identify itself".

Re:User Agent Changes by naniwaduni on Thursday December 12, 2019 @08:36PM (#21778379)
Let's take a look at Firefox!

Mozilla/5.0 (X11; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0

Only, er, half of the version numbers are lies...

Re:User Agent Changes by NullPrefix on Thursday December 12, 2019 @08:44PM (#21778424)
Are you on Wayland?
Re:User Agent Changes by bowmessage on Thursday December 12, 2019 @09:38PM (#21778701)
From the article, there is this recent proposal for "UA-hints": https://github.com/WICG/ua-client-hints
Re:User Agent Changes by onion2k on Friday December 13, 2019 @04:19AM (#21780227)
When is a browser going to just ditch the cruft and present something sensible?

Better still, ditch the UA string entirely. The only thing that will force website developers to write cross-browser compatible progressively enhanced websites and apps is being forced to detect features and test in all browsers instead of just whitelisting Chrome based on the User Agent.

User Agent strings are bad for the web.

Re:User Agent Changes by tropo on Thursday December 12, 2019 @11:36PM (#21779165)
Every browser has to act together, or the ones that don't will win due to better compatibility.

The obvious way to make that happen is a law. Just prohibit the user agent string from being sent, starting with browsers that are distributed after a certain date.

Perhaps a bit of voluntary cooperation is possible. It worked for webassembly.

Re:User Agent Changes by friendly_fren on Thursday December 12, 2019 @11:51PM (#21779215)
That's insane to propose the government should regulate http headers. What happened to freedom of speech?
Re:User Agent Changes by chrismmay on Friday December 13, 2019 @03:14AM (#21779945)
Say for instance, all clients claimed to be Chrome. This would skew analytics towards Chrome, and would clearly benefit Google. If this activity did not benefit Google, Google would fight this activity, presumably on the grounds that other companies are producing a product that claims to be their product when it is not. Since it benefits Google, Google is not compelled to fight this misrepresentation. I argue that Google is evil for allowing this to happen, and that the US government (FTC) should intervene in this area where possible, on anti-trust grounds.
Re:User Agent Changes by GoblinSlayer on Friday December 13, 2019 @09:24AM (#21781777)
If there's nothing to analyze, analytics would lose meaning (it's already a cargo cult though).
Re:User Agent Changes by gruez on Thursday December 12, 2019 @11:57PM (#21779229)
>What happened to freedom of speech?

Deceptive speech is regularly curtailed by the government (eg. fraud, deceptive advertising)

Re:User Agent Changes by speedplane on Friday December 13, 2019 @12:04AM (#21779251)
>> What happened to freedom of speech?

> Deceptive speech is regularly curtailed by the government (eg. fraud, deceptive advertising)

Is spoofing a User-Agent string really deceptive speech? It's just asking a server to return a web-page in the same format as a specific browser... somewhat like asking a salesperson to give you the same price they give everyone else.

Re:User Agent Changes by lukifer on Friday December 13, 2019 @01:59AM (#21779666)
Only a small subset of deceptive speech; it’s perfectly legal to lie about who you voted for, or that you like someone’s haircut. Plausible deniability (my browser is Chrome, I swear) is potentially a means for individual autonomy and counteracting the misuse of power.
Re:User Agent Changes by tuwtuwtuwtuw on Thursday December 12, 2019 @11:57PM (#21779230)
While I agree with your first sentence, freedom of speech doesn't have anything to do with HTTP headers.