Details
Description
Steps to reproduce:
With HTTPie
> http -j -b -a admin:admin localhost:8080
or with cUrl
> curl -u admin:admin http://localhost:8080 --header "Accept: application/json, */*"
In both of the above cases http service selects the first available representation (aka HTML) based on "*/*" instead of more specific JSON.
I think one possible fix is to by default assign higher weight to more specific mime types when Accept header is parsed in org.apache.jackrabbit.oak.http.MediaRange.parse
For example replacing return statement in above method with the following fixed this bug in my testing:
double defaultQ = 3.0; if("*/*".equals(type.getType())) { defaultQ = 1.0; } else if("*".equals(type.getSubtype())) { defaultQ = 2.0; } return new MediaRange(type, defaultQ);