Closed
Bug 1316204
Opened 9 years ago
Closed 9 years ago
Don't include non-ASCII characters (e.g., emoji) in User-Agent strings
Categories
(Firefox for iOS :: General, defect, P1)
Tracking
()
RESOLVED
FIXED
Iteration:
1.9
People
(Reporter: farhan, Assigned: farhan)
References
Details
(Whiteboard: [mobileAS])
Attachments
(1 file)
The emoji I've added to the nightly build bundle name is breaking the testSyncUA test. What do we want to do with this test?
I really like the emojis! So lets try to fix/disable this test for nightly only?
How important is this test? Cause of course emojis are more important
| Assignee | ||
Comment 1•9 years ago
|
||
edit: I was being sarcastic at the end there. I even added an emoji to signal that. But bugzilla removed it. :(
| Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(sleroux)
Comment 2•9 years ago
|
||
Darn. I like the emojis too. We might be able to make the regex less strict in its checking or find a way to match against a unicode character for the emoji. Looking at the regex, I'm sure weakening the the regex check devalues the test a bit but I'm not sure if it's that big of a deal.
A more forgiving regex could be: ^Firefox-iOS-Sync/[0-9\\.]+ .*
This would match the prefix of the strings and version and just leave the app name part to be whatever.
Flags: needinfo?(sleroux)
Comment 3•9 years ago
|
||
The User-Agent header must only contain ASCII.
See e.g., Bug 1188550.
Don't weaken the test, fix the code.
Comment 4•9 years ago
|
||
A more thorough response:
RFC 2616 specifies that User-Agent consists of product and version strings, which are composed of tokens. Token is defined as
token = 1*<any CHAR except CTLs or separators>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
CHAR = <any US-ASCII character (octets 0 - 127)>
CTL = <any US-ASCII control character
(octets 0 - 31) and DEL (127)>
product = token ["/" product-version]
product-version = token
User-Agent = "User-Agent" ":" 1*( product | comment )
Examples:
User-Agent: CERN-LineMode/2.15 libwww/2.17b3
This is why Android has MOZ_APP_ASCII_DISPLAYNAME, so that the User-Agent string it sends is plain ASCII.
If you don't do this correctly, you make Firefox diverge from the HTTP specs, and that's a bad thing.
Component: Build & Test → General
Hardware: Other → All
Summary: Emojis in beta/nightly build names breaks a test → Don't include non-ASCII characters (e.g., emoji) in User-Agent strings
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → fpatel
Iteration: --- → 1.9
Priority: -- → P1
Whiteboard: [mobileAS]
| Assignee | ||
Comment 5•9 years ago
|
||
Lets remove the emoji as failing tests are not a good thing to have.
Attachment #8812280 -
Flags: review?(sleroux)
Comment 6•9 years ago
|
||
Why not just fix the UA while keeping the emoji in the app name?
Updated•9 years ago
|
Attachment #8812280 -
Flags: review?(sleroux) → review+
| Assignee | ||
Comment 7•9 years ago
|
||
We could do that. If it was something important it might have been worth it to make changes to how we handle UA and display names. But for something small like this the path of least resistance is just to revert it back to normal. :(
Comment 8•9 years ago
|
||
Heh, OK. I think the fix would be pretty straightforward if we wanted to keep them though -- we could just fall back to "Firefox" instead of the app name if the AppConstants.BuildChannel == Aurora/Beta/Nightly. Up to you! :winkemoji:
| Assignee | ||
Comment 9•9 years ago
|
||
Ah I see. I'll look into this. But for now, I'll close this one.
master https://github.com/mozilla-mobile/firefox-ios/commit/5d748436938c2088756ade1009cf5f4944486247
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [mobileAS] → [mobileAS][needsuplift]
Comment 10•9 years ago
|
||
v6.x 3a0227a
status-fxios-v6.0:
--- → fixed
status-fxios-v7.0:
--- → fixed
Whiteboard: [mobileAS][needsuplift] → [mobileAS]
You need to log in
before you can comment on or make changes to this bug.
Description
•