Hi,

On Mon, Apr 7, 2014 at 9:24 AM, Felix Meschberger <fmesc...@adobe.com> 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.

>... 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.

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

Reply via email to