Fixes #1845 - Allow null User-Agent in HttpClient.

This commit is contained in:
Simone Bordet 2017-09-25 13:03:26 +02:00
parent b7bd1b25aa
commit 6aafc3b792
1 changed files with 1 additions and 1 deletions

View File

@ -729,7 +729,7 @@ public class HttpClient extends ContainerLifeCycle
*/
public void setUserAgentField(HttpField agent)
{
if (agent.getHeader() != HttpHeader.USER_AGENT)
if (agent != null && agent.getHeader() != HttpHeader.USER_AGENT)
throw new IllegalArgumentException();
this.agentField = agent;
}