tyrus
  1. tyrus
  2. TYRUS-207

ClientEndpointConfig.Configurator#beforeRequest passes only first value of list<String> in headers to server endpoint

    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

      public class ClientConfigurator extends Configurator {
      	@Override
      	public void beforeRequest(Map<String, List<String>> headers) {
                headers.put("aKey", Arrays.asList("header1", "header2", "header3");
              }
      }
      @ServerEndpoint(value = "/echo", configurator = EchoConfigurator.class)
      public class WSCEchoServer {
      ...
      }
      public class EchoConfigurator extends Configurator {
      	@Override
      	public void modifyHandshake(ServerEndpointConfig sec,
      			HandshakeRequest request, HandshakeResponse response) {
      		Map<String, List<String>> map = request.getHeaders();
      		response.getHeaders().putAll(map);
                      //map contains only pair [key,firstValue]=["aKey","header1"]
      	}
      }
      

        Activity

        Hide
        jan.supol added a comment -

        The same is on server side, when put a list on server, the client gets only first value

        Show
        jan.supol added a comment - The same is on server side, when put a list on server, the client gets only first value
        Hide
        Pavel Bucek added a comment -

        fixed in the trunk, rev 706

        Show
        Pavel Bucek added a comment - fixed in the trunk, rev 706

          People

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

            Dates

            • Created:
              Updated:
              Resolved: