hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Schreiber (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1526) No User-Agent set in tunneled proxy connection
Date Wed, 09 Jul 2014 14:31:04 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14056292#comment-14056292

Martin Schreiber commented on HTTPCLIENT-1526:

I found a way to set the user agent in all requests:
HttpClientBuilder builder = HttpClientBuilder.custom();
builder.setRequestExecutor(new HttpRequestExecutor() {
						public void preProcess(final HttpRequest request, final HttpProcessor processor, final
HttpContext context) throws HttpException, IOException {
							if (!request.containsHeader(HTTP.USER_AGENT)) {
								request.addHeader(new BasicHeader(HTTP.USER_AGENT, "Some user agent"));
							super.preProcess(request, processor, context);

> No User-Agent set in tunneled proxy connection
> ----------------------------------------------
>                 Key: HTTPCLIENT-1526
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1526
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.4
>         Environment: Win7, jdk 1.7
>            Reporter: Martin Schreiber
> When making a connection over a proxy, the HttpClient does not send a User-Agent header
to authenticate with the proxy. This is problematic as our proxy only allows connection with
a User-Agent set.
> The deprecated DefaultHttpClient does send the User-Agent info also for the proxy authentication.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message