if (!PATH_PATTERN.matcher(path).matches()) {
return createResponse(request, NOT_FOUND, copiedBuffer("Not found", UTF_8));
}
if (request.headers().contains(HttpHeaders.Names.IF_NONE_MATCH)) {
final FullHttpResponse response = createResponse(request, NOT_MODIFIED);
response.headers().set(HttpHeaders.Names.SET_COOKIE, "JSESSIONID=dummy; path=/");
return response;
} else {
final String content = createContent(config.sockJsUrl());
final FullHttpResponse response = createResponse(request, OK, copiedBuffer(content, UTF_8));
response.headers().set(HttpHeaders.Names.CONTENT_TYPE, "text/html; charset=UTF-8");
response.headers().set(HttpHeaders.Names.CACHE_CONTROL, "max-age=31536000, public");
response.headers().set(HttpHeaders.Names.EXPIRES, generateExpires());
final String etag = '\"' + generateMd5(content) + '\"';
response.headers().set(HttpHeaders.Names.ETAG, etag);
return response;
}
}