tyrus
  1. tyrus
  2. TYRUS-211

HandshakeRequest.getParameterMap is not umodifiable

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      javadoc says:

      Returns:
      the unmodifiable map of the request parameters.

      It is not unmodifiable:

      public class ReadonlyGetParamsConfigurator 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.getParameterMap();
      		try {
      			map.put(KEY, Arrays.asList(VALUES));
      		} catch (Exception e) {
      		}
      		map = request.getParameterMap();
      		response.getHeaders().putAll(map);
      	}
      }
      

      The headers on client contains ReadOnlyKey.

        Activity

        Hide
        Pavel Bucek added a comment -

        fixed in the trunk (svn rev 718)

        Show
        Pavel Bucek added a comment - fixed in the trunk (svn rev 718)

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: