You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jovan Attisha (Jira)" <ji...@apache.org> on 2022/03/07 15:35:00 UTC
[jira] [Reopened] (HTTPCORE-709) BasicHttpRequest throws IllegalArgumentException for path starting with multiple slashes with authority
[ https://issues.apache.org/jira/browse/HTTPCORE-709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jovan Attisha reopened HTTPCORE-709:
------------------------------------
I agree that the path alone is invalid, but the spec calls out that this is only an invalid path if the authority is not present. So I completely agree that a relative URL of // is invalid, but [https://google.com//] should be valid according to [the spec|https://datatracker.ietf.org/doc/html/rfc3986#section-3.3]?
{quote}If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character. If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//").
{quote}
> BasicHttpRequest throws IllegalArgumentException for path starting with multiple slashes with authority
> -------------------------------------------------------------------------------------------------------
>
> Key: HTTPCORE-709
> URL: https://issues.apache.org/jira/browse/HTTPCORE-709
> Project: HttpComponents HttpCore
> Issue Type: Bug
> Components: HttpCore
> Affects Versions: 5.0.1, 5.1.1, 5.1.2, 5.1.3, 5.1, 5.2-alpha1, 5.2-alpha2
> Reporter: Jovan Attisha
> Priority: Major
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> [This commit|https://github.com/apache/httpcomponents-core/commit/1614d5d5a5de6f4faadff9ecb566982d56b65179] to BasicHttpRequest attempts to make BasicHttpRequest conform to RFC3986, but I actually don't think this is properly following spec. [The RFC|https://datatracker.ietf.org/doc/html/rfc3986#section-3.3] says that:
> If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character. If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//").
> However, the code blocks a double slash no matter what, even if there is an authority component. So calling:
> {code:java}
> new BasicHttpRequest("GET", new URI("https://google.com//"));{code}
> throws an IllegalArgumentException.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org