code: private static boolean processHopByHopHeaders(HttpSession src, HttpSession dest) {
          Set<String> hopByHopHeaders = getHopByHopHeaders(src);
          boolean upgrade = src.getReadHeader(HEADER_UPGRADE) != null;
          if (upgrade) {
              hopByHopHeaders.remove(HEADER_UPGRADE);
          }
  
          // Add source session headers to destination session
          for (Map.Entry<String, List<String>> e : src.getReadHeaders().entrySet()) {
              String name = e.getKey();
              for (String value : e.getValue()) {
                  if (!hopByHopHeaders.contains(name)) {
                      dest.addWriteHeader(name, value);
                  }
              }
          }
  
          return upgrade;
      }
docs: /*
  Write all (except hop-by-hop) headers from source session to destination session.
  
  If the header is an upgrade one, let the Upgrade header go through as this service supports upgrade