Hi,

I would like to propose changes to MediaTypeMapper.

First, I think we should make it externally configurable as right now,
it's internal.

Second, I was hoping to change the interface slightly for determining
if there's a match.  Basically, allow the media type mapper to work
with any incoming request headers instead of just user-agents.

In MediaTypeMapper:

public MediaType mapOutputMediaType(MediaType responseMediaType,
String userAgent)

would change to:

public MediaType mapOutputMediaType(MediaType responseMediaType,
HttpHeaders requestHeaders)

and:

In MappingRecord:
        boolean match(String userAgent, MediaType responseMediaType);
would change to:
        boolean match(HttpHeaders requestHeaders, MediaType responseMediaType);

I imagine a future use case may be that the user agent header may not
be the only header that has to be taken into consideration and maybe a
user agent match can't be done with just a starting with.

Thoughts?

-- 

- Bryant Luk

Reply via email to