users@jsr311.java.net

Case-insensitive Response.getMetadata

From: Sergey Beryozkin <sberyozk_at_progress.com>
Date: Tue, 28 Apr 2009 14:48:49 -0400

Hi

 

I'd like to confirm that MultivaluedMap<String, Object> instance
returned by

Response.getMetadata() is case-insensitive.

 

Ex.

MultivaluedMap<String, Object> headers =
ResponseBuilder.ok().header("Content-Type",
"text/xml").build().getMetadata();

assertNotNull(headers.getFirst("content-type"));

 

Is it correct ?

 

If yes, then given that Response.getMetadata() is modifiable, what is
the value of content type after

 

headers.putSingle("content-type", "application/xml");

 

is it

 

assertEquals("application/xml", headers.getFirst("content-type"));

assertEquals("application/xml", headers.getFirst("Content-Type"));

 

?

 

Another question :

 

ResponseBuilder.ok().header("Content-Type", "text/xml")
.header("content-type", "text/plain").build().get("Content-Type");

 

Is it text/xml or text/plain or { text/xml , text/plain} ?

 

Thanks, Sergey