hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ram (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1682) HttpClient should allow NO port
Date Mon, 31 Aug 2015 05:56:51 GMT

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

Ram commented on HTTPCLIENT-1682:
---------------------------------

It happens when using:
org.apache.http.impl.client.CloseableHttpClient.execute(HttpHost target, HttpRequest request,
HttpContext context) throws IOException, ClientProtocolException
When the target port is -1 (default) the default SchemePortResolver called by the default
route planner (DefaultRoutePlanner) changes the port according to the protocol (http/https).

> HttpClient should allow NO port
> -------------------------------
>
>                 Key: HTTPCLIENT-1682
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1682
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>            Reporter: Nathan Hazout
>
> I've noticed that the CNN RSS (rss.cnn.com/rss/edition.rss) worked on some applications
but not on mine.
> Looking deeper, I saw that CNN rejects HTTP requests with
> Host: rss.cnn.com:80
> But accepts requests with
> Host: rss.cnn.com
> Even though 80 is the default port, it only accepts requests with NO port.
> According to the HTTP standards, this is a valid request (even if, granted, strange).
Also, I've noticed that major browsers (tested on chrome) strip out the port from the request
when it is 80.
> However, using HttpClient, setting no port still forces port 80 into the headers.
> Shouldn't HttpClient let the developer set no port all all?
> I'm not saying to automatically strip out the port like Chrome does, but maybe let the
developer decide - if he sets no port, then don't set a port for him automatically?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message