Description:
|
When checking http headers against what is defined in produces in a route, the DefaultRoute.java class doesn't appear to take q=x into consideration. For example, an accept header can look like so: Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
When DefaultRoute is looking in here, it splits on comma (',') and leaves in the q=x value (i.e. text/html;q=0.9). So it will check if (in produces) test/html = test/html;q=0.9 and fail the comparison. This comparison is done in matchesProduces in org.jboss.aerogear.controller.router.DefaultRoute. It also doesn't appear to handle "image/*", ideally that should match "image/png", "image/jpg", etc. This is causing some 404 returns from the controller.
A good reference: http://www.gethifi.com/blog/browser-rest-http-accept-headers
|
I've split this issue into two parts, one bug (AEROGEAR-1085) and this task which I consider to be a feature request.
This task will cover adding functionality to be able to specify a quality factor ,and AEROGEAR-1085 will cover the bug regarding matching 'Accept' media-types to routes (including the ranges support using '*').