-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User-Agent string lists system before product, contrary to RFC 7231 recommendation #3253
Comments
Putting it first (before |
Side note: I confirmed that the tile requests from OSMDroid do not use the same HTTP infrastructure. Those requests look like this, and would need to have their headers set separately:
|
@zestyping I'm hoping you'll enjoy #3254 (writing the description up right now). |
I just tried the same experiment with Mapbox, and discovered that it makes its own User-Agent string as well:
|
We can't change the Mapbox one, though. It's statically defined: |
Great to see that Mapbox uses the application ID as well. Upon further reflection, I think we should keep that part. Seems totally fine for Mapbox to set its own User-Agent string since it's just communicating with its own servers, anyway. |
If/when we give it tile URL templates (e.g. if we use it to replace OSMDroid), it'll fetch those tiles from whatever other servers using that User-Agent. I like their User-Agent string though; it looks totally reasonable to me. |
Oh, right, I hadn't thought about that! But yes, I agree that it's reasonable even in that context. If servers are doing throttling based on |
The goal is to get to something that looks like |
@opendatakit-bot claim |
I wrote above that "The goal is to get to something that looks like Dalvik/2.1.0 org.odk.collect.android/v1.5.1-10-ge20fa334-dirty (Linux; U; Android 5.1.1; hi6210sft Build/LMY47X)" but I now don't understand why. It seems that if we're going by decreasing order of usefulness for identifying the agent, it should be @SaumiaSinghal, @seadowg, can either of you think of a reason of why I may have split the host identifier? I wonder whether I was just going too quickly and made a mistake. |
No actually! Your new example makes more sense to me. |
Yes, also the tests don't fail like that. :) |
As I looked at addressing #3252, I noticed that the User-Agent string currently used in requests does not follow the order recommended by RFC 7231:
As described by #800 and shown in tests, Collect's User-Agent string looks like:
Dalvik/2.1.0 (Linux; U; Android 5.1.1; hi6210sft Build/LMY47X) org.odk.collect.android/v1.5.1-10-ge20fa334-dirty
The RFC only makes a recommendation so this is not a big deal but I wanted to at least make the decision explicit.
I'm guessing that it was done this way because the application ID looks odd at the head.
Using the application ID is also unorthodox, I think. It has the nice property of ensuring that forks by default provide an identifying User-Agent string. But we could also easily put a string in a config file that forks don't get and have forks be identified as something like "UnidentifiedODKCollectFork".@zestyping discovered in #3253 (comment) that Mapbox uses the application ID as well. Thinking about it more, I think it's the right way to go.Is it worth changing either the order
or the product name or both? I think this is unlikely to be disruptive so I would tend to change it but I may not be thinking of ways this could break downstream tools. Naturally, it would reset quotas based on User-Agent strings.CC @zestyping @yanokwa
The text was updated successfully, but these errors were encountered: