A lot of "Explicitly set request header User-agent: Apache HttpClient/4.2.6(java 1.5) is ignored"

780 views
Skip to first unread message

Richard Grossman

unread,
Jan 12, 2014, 8:57:47 AM1/12/14
to spray...@googlegroups.com
Hi

I'm debugging our application using typessafe console and we get a lot of this warning :
A lot of "Explicitly set request header User-agent: Apache HttpClient/4.2.6(java 1.5) is ignored" illegal Raw Header

The message is explicit but how to get ride of it and how to set the headers as we want ?
I've tried to add to add  illegal-header-warnings = off in the spray.can.parsing section 
but I think it's just handle the illegal header you get from server but this warning is sent from the httpClient where it's illegal to set non valid headers

Thanks for help

Richard

Johannes Rudolph

unread,
Jan 12, 2014, 9:15:06 AM1/12/14
to spray...@googlegroups.com
Hi Richard,

On Sun, Jan 12, 2014 at 2:57 PM, Richard Grossman <rich...@gmail.com> wrote:
> I'm debugging our application using typessafe console and we get a lot of
> this warning :
> A lot of "Explicitly set request header User-agent: Apache
> HttpClient/4.2.6(java 1.5) is ignored" illegal Raw Header

It seems you are creating a User-Agent header with
`RawHeader("User-Agent", ...)` which isn't allowed for a set of
particular headers, User-Agent belonging to that set. Try using either
`HttpHeaders.`User-Agent`(...)` instead of RawHeader or pass the
RawHeader into `HttpParser.parseHeader` to convert it into the other
form.


--
Johannes

-----------------------------------------------
Johannes Rudolph
http://virtual-void.net

Richard Grossman

unread,
Jan 12, 2014, 11:41:38 AM1/12/14
to spray...@googlegroups.com, johannes...@googlemail.com
Thanks you very much 
Rid off this warning
Reply all
Reply to author
Forward
0 new messages