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
In the case of using setHttpHeader("carrier", ""中国电信"").
Note: 中国电信 is a Chinese telecommunications (cell phone provider carrier).
No pending exception expected: java.lang.IllegalArgumentException: Unexpected char 0x4e2d at 243 in User-Agent value
at void okhttp3.Headers$Companion.checkValue(java.lang.String, java.lang.String) (Headers.kt:450)
at void okhttp3.Headers$Companion.access$checkValue(okhttp3.Headers$Companion, java.lang.String, java.lang.String) (Headers.kt:362)
at okhttp3.Headers$Builder okhttp3.Headers$Builder.add(java.lang.String, java.lang.String) (Headers.kt:261)
at okhttp3.Request$Builder okhttp3.Request$Builder.addHeader(java.lang.String, java.lang.String) (Request.kt:210)
at <snipped>.setHttpHeader(java.lang.String, java.lang.String) (HttpClientRequest.java
The currently existing code snippet causes an issue.
I believe the possible fix is to add a this.headersBuilder = new Headers.Builder();
and then switch setHttpHeader to this.headersBuilder = headersBuilder.addUnsafeNonAscii(name, value);
Then in the doRequestAsync add this.requestBuilder.headers(this.headersBuilder.build()); before the OK_Client call
or to 'build and set' in every set. Just depends if you want to do a lot of duplicate work or not.
We are running a modified version of libhttpclient, so our fix is applied there. I'll see if/when I have time to PR this change into libHttpClient proper, but if not, above should help anyone who comes across similar issue.
The text was updated successfully, but these errors were encountered:
Nice catch with this, appreciate the heads up! 😄 I'll look into pulling this fix into LibHC whenever I find time, but if you get around to PR-ing it that would be great. I'll leave this issue up for vis in the meantime.
No pending exception expected: java.lang.IllegalArgumentException: Unexpected char
square/okhttp#6347
square/okhttp#4008
square/okhttp#7275
square/okhttp#4296
In the case of using
setHttpHeader("carrier", ""中国电信"")
.Note: 中国电信 is a Chinese telecommunications (cell phone provider carrier).
The currently existing code snippet causes an issue.
I believe the possible fix is to add a
this.headersBuilder = new Headers.Builder();
and then switch setHttpHeader to
this.headersBuilder = headersBuilder.addUnsafeNonAscii(name, value);
Then in the doRequestAsync add
this.requestBuilder.headers(this.headersBuilder.build());
before the OK_Client callor to 'build and set' in every set. Just depends if you want to do a lot of duplicate work or not.
We are running a modified version of libhttpclient, so our fix is applied there. I'll see if/when I have time to PR this change into libHttpClient proper, but if not, above should help anyone who comes across similar issue.
The text was updated successfully, but these errors were encountered: