if (isWebSocketEnabled()) { if (requestInfo != null) { logger.debug("Processing transport request: " + requestInfo); String transport = pathSegments[2]; if (!isWebSocketEnabled() && transport.equals("websocket")) { if (requestInfo != null) { logger.debug("WebSocket disabled. Ignoring transport request: " + requestInfo);
@Override public void handle(ServerHttpRequest request, ServerHttpResponse response) throws IOException { if (request.getMethod() == HttpMethod.GET) { addNoCacheHeaders(response); if (checkOrigin(request, response)) { response.getHeaders().setContentType(new MediaType("application", "json", StandardCharsets.UTF_8)); String content = String.format( INFO_CONTENT, random.nextInt(), isSessionCookieNeeded(), isWebSocketEnabled()); response.getBody().write(content.getBytes()); } } else if (request.getMethod() == HttpMethod.OPTIONS) { if (checkOrigin(request, response)) { addCacheHeaders(response); response.setStatusCode(HttpStatus.NO_CONTENT); } } else { sendMethodNotAllowed(response, HttpMethod.GET, HttpMethod.OPTIONS); } } };
if (isWebSocketEnabled()) { if (requestInfo != null) { logger.debug("Processing transport request: " + requestInfo); String transport = pathSegments[2]; if (!isWebSocketEnabled() && transport.equals("websocket")) { if (requestInfo != null) { logger.debug("WebSocket disabled. Ignoring transport request: " + requestInfo);
if (isWebSocketEnabled()) { if (requestInfo != null) { logger.debug("Processing transport request: " + requestInfo); String transport = pathSegments[2]; if (!isWebSocketEnabled() && transport.equals("websocket")) { if (requestInfo != null) { logger.debug("WebSocket disabled. Ignoring transport request: " + requestInfo);
@Override public void handle(ServerHttpRequest request, ServerHttpResponse response) throws IOException { if (request.getMethod() == HttpMethod.GET) { addNoCacheHeaders(response); if (checkOrigin(request, response)) { response.getHeaders().setContentType(new MediaType("application", "json", StandardCharsets.UTF_8)); String content = String.format( INFO_CONTENT, random.nextInt(), isSessionCookieNeeded(), isWebSocketEnabled()); response.getBody().write(content.getBytes()); } } else if (request.getMethod() == HttpMethod.OPTIONS) { if (checkOrigin(request, response)) { addCacheHeaders(response); response.setStatusCode(HttpStatus.NO_CONTENT); } } else { sendMethodNotAllowed(response, HttpMethod.GET, HttpMethod.OPTIONS); } } };
@Override public void handle(ServerHttpRequest request, ServerHttpResponse response) throws IOException { if (request.getMethod() == HttpMethod.GET) { addNoCacheHeaders(response); if (checkOrigin(request, response)) { response.getHeaders().setContentType(new MediaType("application", "json", StandardCharsets.UTF_8)); String content = String.format( INFO_CONTENT, random.nextInt(), isSessionCookieNeeded(), isWebSocketEnabled()); response.getBody().write(content.getBytes()); } } else if (request.getMethod() == HttpMethod.OPTIONS) { if (checkOrigin(request, response)) { addCacheHeaders(response); response.setStatusCode(HttpStatus.NO_CONTENT); } } else { sendMethodNotAllowed(response, HttpMethod.GET, HttpMethod.OPTIONS); } } };