[ https://issues.apache.org/jira/browse/HTTPCORE-709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17502352#comment-17502352 ]
Jovan Attisha edited comment on HTTPCORE-709 at 3/7/22, 3:34 PM: ----------------------------------------------------------------- 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} was (Author: JIRAUSER286168): 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? {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-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org