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

Felix Meschberger closed SLING-778.
-----------------------------------

    Resolution: Fixed

Rev. 726787 implements this enhancements in that the revers mappings are 
consolidated by the internal path to be mapped to multiple extension path 
options. The JcrResourceResolver.map method is extended to select the best 
option of multiple options by checking for the option with the same 
scheme/host/port prefix as given by the request.

If the request is not available or no such option is available, the first 
option is selected, which is the first configuration entry for the given 
internal path.

In addition the reverse mappings are ordered according to the length of the 
internal paths, such that the best match for internal path is selected.

> ResourceResolver.map not taking best match into account
> -------------------------------------------------------
>
>                 Key: SLING-778
>                 URL: https://issues.apache.org/jira/browse/SLING-778
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR Resource
>    Affects Versions: JCR Resource 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.4
>
>
> Consider the configuration:
>      http/en.host.com -> [ /content/en, / ]
>      http/de.host.com -> [ /content/de, / ]
> Here a path /content/en/something is converted correctly to 
> http://en.host.com/something while a path /content/de/etwas is incorrectly 
> converted to http://en.host.com/content/de/etwas instead of 
> http://de.host.com/etwas.
> Two issues are related to this problem:
>    1. the map method should consider the mappings using a longest match 
> strategy instead of a first-match
>    2. If two mappings with the same length apply, the one with the best 
> scheme/host/port match should be used

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to