You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
If the app name contains characters that are not allowed in an HTTP header this will cause an exception in MapboxEventManager when dispatching the events.
As the user agent below indicates I'm using the 4.0.0 SNAPSHOT build (the one from March 15th I believe)
Doesn't crash the app, so not terribly critical (for me).
E/MapboxEventManager: FlushTheEventsTask borked: java.lang.IllegalArgumentException: Unexpected char 0xe4 at 11 in User-Agent value: Sveriges Fjäll/1.0/1 MapboxEventsAndroid/4.0.0-SNAPSHOT
W/System.err: java.lang.IllegalArgumentException: Unexpected char 0xe4 at 11 in User-Agent value: Sveriges Fjäll/1.0/1 MapboxEventsAndroid/4.0.0-SNAPSHOT
W/System.err: at okhttp3.Headers$Builder.checkNameAndValue(Headers.java:283)
W/System.err: at okhttp3.Headers$Builder.set(Headers.java:263)
W/System.err: at okhttp3.Request$Builder.header(Request.java:165)
W/System.err: at com.mapbox.mapboxsdk.telemetry.MapboxEventManager$FlushTheEventsTask.doInBackground(MapboxEventManager.java:622)
W/System.err: at com.mapbox.mapboxsdk.telemetry.MapboxEventManager$FlushTheEventsTask.doInBackground(MapboxEventManager.java:516)
W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:292)
W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err: at java.lang.Thread.run(Thread.java:818)
The text was updated successfully, but these errors were encountered:
@tobrun Thanks! Just to be sure, in the linked ticket the events are successfully sent (I assume so based on the reference to staging) although the user agent string is a bit odd. In this case it fails to encode on the client.
Apologies, I was a bit too fast assuming it was related. This is indeed another problem.
After looking into this it appears that we are not able to encode ä. After checking the okhttp repo,
I have found this issue square/okhttp#891 (comment).
Since we are dynamically generating the user agent, we should sanitise the input.
I was able to solve this by reusing OkHttp's internal Util.toHumanReadableAscii() method to ensure that it's all Ascii all the time. Tested it out in the MapboxEventsManager and the newly created HttpTransportTest class using Swedish UA given above. Everything is 👌 .
If the app name contains characters that are not allowed in an HTTP header this will cause an exception in MapboxEventManager when dispatching the events.
As the user agent below indicates I'm using the 4.0.0 SNAPSHOT build (the one from March 15th I believe)
Doesn't crash the app, so not terribly critical (for me).
The text was updated successfully, but these errors were encountered: