IllegalArgumentException: Unexpected char ... in header value: ... at com.squareup.okhttp.Headers$Builder.checkNameAndValue (Headers.java:295)
See original GitHub issueI get crash reports like that:
java.lang.IllegalArgumentException: Unexpected char 0x43a at 101 in header value: Mozilla/5.0 (Linux; U; Android 4.1.2; ru-ru; PMP7170B3G_DUO Build/JZO54K) AppleWebKit/534.30 (KHTML, как Gecko) Version/4.0 МобильныйSafari/534.30
at com.squareup.okhttp.Headers$Builder.checkNameAndValue (Headers.java:295)
at com.squareup.okhttp.Headers$Builder.set (Headers.java:275)
at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.setRequestProperty (HttpURLConnectionImpl.java:526)
<some 3rd library code I don't have access to>
Seems to happen due to non-ASCII chars in header value. Similar to #1998. But #1998 is about response header and my smacktrace is about request header.
Thank you!
Issue Analytics
- State:
- Created 8 years ago
- Comments:40 (8 by maintainers)
Top Results From Across the Web
okhttp: IllegalArgumentException: Unexpected char 0xea
We can use addUnsafeNonAscii to solve this issue. Below is the simple code snippet of it. Headers headers = new Headers.Builder() .
Read more >java.lang.IllegalArgumentException: Unexpected char 0x4e00 ...
IllegalArgumentException : Unexpected char 0x4e00 at 25 in header value: ... checkNameAndValue(Headers.java:295) at com.squareup.okhttp.
Read more >HttpClient exception unexpected char in header value - MSDN
What we are seeing is that when making calls using HttpClient to our API an exception is thrown when the http client parses...
Read more >Apache Nifi - On Passing Apikey In Invokehttp Processor It Is ...
IllegalArgumentException : Unexpected char in header value: at com.squareup.okhttp.HeadersBuilder.checkNameAndValue Headers.java:.
Read more >Unexpected char 0x131 at 23 in User-Agent value: selenium ...
... IllegalArgumentException: Unexpected char ... in header value: ... at com.squareup.okhttp.Headers$Builder.checkNameAndValue (Headers.java:295) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I used only NO_WRAP and it seems to work at the moment. I will try to write a test case with the Base64.DEFAULT flag only.
Patrick
https://www.streetlife.com.mx powered by Alpha Wave Systems On Dec 11, 2015 15:16, “Kannan Goundan” notifications@github.com wrote:
I did ask the question on StackOverflow and now that I know the answer I added it on Stackoverflow.