You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Francois-Xavier Bonnet (JIRA)" <ji...@apache.org> on 2017/02/17 03:09:42 UTC

[jira] [Resolved] (HTTPCORE-445) Path matching issue when a query string is present in the URI

     [ https://issues.apache.org/jira/browse/HTTPCORE-445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francois-Xavier Bonnet resolved HTTPCORE-445.
---------------------------------------------
       Resolution: Fixed
    Fix Version/s: 5.0-alpha3

> Path matching issue when a query string is present in the URI
> -------------------------------------------------------------
>
>                 Key: HTTPCORE-445
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-445
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 5.0-alpha2, 5.0-alpha3
>            Reporter: Francois-Xavier Bonnet
>            Assignee: Francois-Xavier Bonnet
>            Priority: Minor
>             Fix For: 5.0-alpha3
>
>         Attachments: Main.java
>
>
> If I register a handler with pattern "/test*" it successfully matches "/test" or "/test/abcd" but surprisingly it does not match "/test?x=y"
> Looking at the code:{code:title=AsyncServerExchangeHandlerRegistry.create(HttpRequest)|borderStyle=solid} 
> 78        final int i = path.indexOf("?");
> 79        if (i != -1) {
> 80            path = path.substring(0, i - 1);
> 81        }
> {code}
> Doing this removes the last character before the query string, "/test?x=y" becomes "/tes" which does not match.
> I attached a sample class to reproduce the issue.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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