Hi Am 07.04.2014 um 09:42 schrieb Bertrand Delacretaz <[email protected]>:
> Hi, > > On Mon, Apr 7, 2014 at 9:24 AM, Felix Meschberger <[email protected]> wrote: >> ...TL;DR: Use Accept header to set request's selectors and extension. So an >> example Accept content type >> of "application/x-players+json" would set the selector string to "players" >> and the extension to "json"... > > I like the idea, but only if there are no extensions nor selectors in > the current request, otherwise it's confusing. See the conditions I listed at the end of my proposal :-) > >> ... This could be done in the Sling Engine's SlingRequestPathInfo >> constructor under the following conditions: >> >> * Extension (and optional selectors) have not derived from the URL yet >> * Accept header has a single content type (Browsers generally send a list of >> supported types)... > > I'd rather leave the decision to a plugin that the > SlingRequestPathInfo constructor calls only if there is no extension > and no selectors. The plugin gets the request object and can return > extension + selectors. I would prefer to not go over board, at least not initially, and keep it simple and covering simple use cases. Regards Felix > > We can then implement something like you suggest, that users can > replace that with their own algorithms if needed. > >> ...Only if Accept header has a single content type... > > Might be fine for your use cases, but using a plugin also allows for > more sophisticated content negociation. > > -Bertrand
