You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Roland Weber (JIRA)" <ji...@apache.org> on 2007/02/20 20:19:05 UTC
[jira] Created: (HTTPCORE-47) HttpRequestHandlerRegistry results
are ambiguous
HttpRequestHandlerRegistry results are ambiguous
------------------------------------------------
Key: HTTPCORE-47
URL: https://issues.apache.org/jira/browse/HTTPCORE-47
Project: HttpComponents Core
Issue Type: Bug
Components: HttpCore
Reporter: Roland Weber
Priority: Minor
HttpRequestHandlerRegistry uses pattern matching to determine the handler to use.
The best match comparison is exclusively based on pattern length and therefore ambiguos:
patterns "/ma*" and "*tch" both match "/match".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Commented: (HTTPCORE-47) HttpRequestHandlerRegistry results
are ambiguous
Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474730 ]
Roland Weber commented on HTTPCORE-47:
--------------------------------------
Hi Oleg,
I don't know what Spring does exactly. The best-match comparison is meant to disambiguate the patterns, and that falls short.
There are two easy ways to disambiguate:
- favor pattern* over *pattern (or vice versa)
- use a LinkedHashMap and favor the pattern added first (or last)
Given the simplicity of either decision, I don't think we should leave the ambiguity in there.
cheers,
Roland
> HttpRequestHandlerRegistry results are ambiguous
> ------------------------------------------------
>
> Key: HTTPCORE-47
> URL: https://issues.apache.org/jira/browse/HTTPCORE-47
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore
> Reporter: Roland Weber
> Priority: Minor
>
> HttpRequestHandlerRegistry uses pattern matching to determine the handler to use.
> The best match comparison is exclusively based on pattern length and therefore ambiguos:
> patterns "/ma*" and "*tch" both match "/match".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Updated: (HTTPCORE-47) HttpRequestHandlerRegistry results
are ambiguous
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski updated HTTPCORE-47:
--------------------------------------
Fix Version/s: 4.0-alpha4
Aha, now I see what you mean. We can't use LinkedHashMap as it is not available in Java 1.3, but we can just add an internal List to keep track of the handler order.
Oleg
> HttpRequestHandlerRegistry results are ambiguous
> ------------------------------------------------
>
> Key: HTTPCORE-47
> URL: https://issues.apache.org/jira/browse/HTTPCORE-47
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore
> Reporter: Roland Weber
> Priority: Minor
> Fix For: 4.0-alpha4
>
>
> HttpRequestHandlerRegistry uses pattern matching to determine the handler to use.
> The best match comparison is exclusively based on pattern length and therefore ambiguos:
> patterns "/ma*" and "*tch" both match "/match".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Commented: (HTTPCORE-47) HttpRequestHandlerRegistry results
are ambiguous
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474579 ]
Oleg Kalnichevski commented on HTTPCORE-47:
-------------------------------------------
Roland,
With all due respect I do not think this is a legitimate issue. Pattern matching based on wildcards is inherently ambiguous. The algorithm used by HttpRequestHandlerRegistry is also used by Spring framework, for instance. If it is good enough for Spring, I do not see why it should not be good enough for HttpCore
Oleg
> HttpRequestHandlerRegistry results are ambiguous
> ------------------------------------------------
>
> Key: HTTPCORE-47
> URL: https://issues.apache.org/jira/browse/HTTPCORE-47
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore
> Reporter: Roland Weber
> Priority: Minor
>
> HttpRequestHandlerRegistry uses pattern matching to determine the handler to use.
> The best match comparison is exclusively based on pattern length and therefore ambiguos:
> patterns "/ma*" and "*tch" both match "/match".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Resolved: (HTTPCORE-47) HttpRequestHandlerRegistry results
are ambiguous
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-47?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski resolved HTTPCORE-47.
---------------------------------------
Resolution: Fixed
Implemented the first option (suffix patterns 'blah*' favored over prefix ones '*blah')
Oleg
> HttpRequestHandlerRegistry results are ambiguous
> ------------------------------------------------
>
> Key: HTTPCORE-47
> URL: https://issues.apache.org/jira/browse/HTTPCORE-47
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore
> Reporter: Roland Weber
> Priority: Minor
> Fix For: 4.0-alpha4
>
>
> HttpRequestHandlerRegistry uses pattern matching to determine the handler to use.
> The best match comparison is exclusively based on pattern length and therefore ambiguos:
> patterns "/ma*" and "*tch" both match "/match".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org