-
Notifications
You must be signed in to change notification settings - Fork 595
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 fails to parse Facebook in App string #4293
Comments
Coded adaption process as
|
Is the config |
Ah, sorry, you mentioned it works as expected with another user agent string, so it is something about the value then |
Ok, reading up a bit more it seems that the FB user-agent header value is not RFC compliant. We have previously silenced logging warnings for such (#687), but in this case you want it parsed. I'm not sure we want to change our current stance, which is to stay aligned with RFC rather than handle special cases, especially givent that it is possible to work around (thanks for sharing workaround btw). |
A user agent string provided by a Facebook in-app browser causes the parsing functions not to resolve a User-Agent header.
Based on the following user agent
Mozilla/5.0 (Linux; Android 13; SM-G981B Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/115.0.5790.138 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/425.0.0.22.49;]
and subsequent usage of
headerValueByType(
User-Agent)
Any HTTP call results in
which feeds into
HttpRequest
headers. Debugging shows that the values of the headersval headers: immutable.Seq[HttpHeader],
is aRawHeader('user-agent', '...')
when the FB user agent string is supplied. However, if this is cleaned the header instance is indeed aUser-Agent
instance, hence the extraction function appears to work.There are some other related bugs such as guardian/support-frontend#213
My current fix is to run an adaption filter when booting the server to strip out the [FB_IAB.*] on each request however the issue appears to be in the parsing of the SimpleHeaders and its ability to instantiate the User-Agent instance based on the pattern.
The text was updated successfully, but these errors were encountered: