@Test
 public void ifNoneMatchHeader() throws Exception {
   final SockJsConfig config = config();
   final String path = config.prefix() + "/iframe.html";
   final HttpRequest httpRequest = createHttpRequest(path);
   httpRequest.headers().set(HttpHeaders.Names.IF_NONE_MATCH, "*");
   final FullHttpResponse response = Iframe.response(config, httpRequest);
   assertThat(
       response.headers().get(HttpHeaders.Names.SET_COOKIE), equalTo("JSESSIONID=dummy; path=/"));
   assertThat(response.getStatus().code(), is(HttpResponseStatus.NOT_MODIFIED.code()));
 }
Exemplo n.º 2
0
  public static final class ResponseStatusCodes {
    public static final int CONTINUE_100 = HttpResponseStatus.CONTINUE.code();
    public static final int SWITCHING_PROTOCOLS_101 = HttpResponseStatus.SWITCHING_PROTOCOLS.code();
    public static final int OK_200 = HttpResponseStatus.OK.code();
    public static final int MOVED_PERMANENTLY_301 = HttpResponseStatus.MOVED_PERMANENTLY.code();
    public static final int FOUND_302 = HttpResponseStatus.FOUND.code();
    public static final int SEE_OTHER_303 = HttpResponseStatus.SEE_OTHER.code();
    public static final int NOT_MODIFIED_304 = HttpResponseStatus.NOT_MODIFIED.code();
    public static final int TEMPORARY_REDIRECT_307 = HttpResponseStatus.TEMPORARY_REDIRECT.code();
    public static final int UNAUTHORIZED_401 = HttpResponseStatus.UNAUTHORIZED.code();
    public static final int PROXY_AUTHENTICATION_REQUIRED_407 =
        HttpResponseStatus.PROXY_AUTHENTICATION_REQUIRED.code();

    private ResponseStatusCodes() {}
  }