[TYRUS-208] HandshakeRequest.getHeaders is not readonly Created: 02/Jul/13  Updated: 03/Jul/13  Resolved: 03/Jul/13

Status: Resolved
Project: tyrus
Component/s: None
Affects Version/s: 1.1
Fix Version/s: 1.2

Type: Bug Priority: Major
Reporter: jan.supol Assignee: Pavel Bucek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

javadoc says:

Return the read only Map of Http Headers that came with the handshake request.

but the following code adds to the map (and to a response):

public class ReadonlyGetHeadersConfigurator extends Configurator {
	static final String KEY = "ReadOnlyKey";
	static final String [] VALUES = { "ReadOnlyValue1", "ReadOnlyValue2" };

	@Override
	public void modifyHandshake(ServerEndpointConfig sec,
			HandshakeRequest request, HandshakeResponse response) {
		Map<String, List<String>> map = request.getHeaders();
		try {
			map.put(KEY, Arrays.asList(VALUES));
		} catch (Exception e) {
			// possible, but not mandatory
		}
		map = request.getHeaders();
		response.getHeaders().putAll(map);
	}
}


 Comments   
Comment by Pavel Bucek [ 03/Jul/13 ]

fixed in the trunk (rev 707)

Generated at Tue Aug 04 03:50:23 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.