private HttpHandler configureRootHandler() { AccessLogService logService = accessLogService; HttpHandler rootHandler = pathHandler; ArrayList<UndertowFilter> filters = new ArrayList<>(this.filters); //handle options * requests rootHandler = new OptionsHandler(rootHandler); //handle requests that use the Expect: 100-continue header rootHandler = Handlers.httpContinueRead(rootHandler); rootHandler = LocationService.configureHandlerChain(rootHandler, filters); if (logService != null) { rootHandler = logService.configureAccessLogHandler(rootHandler); } // handle .well-known requests from ACME certificate authorities String path = WildFlySecurityManager.getPropertyPrivileged("jboss.home.dir", "."); Path base; try { base = Paths.get(path).normalize().toRealPath(); } catch (IOException e) { throw new RuntimeException(e); } final int cacheBufferSize = 1024; final int cacheBuffers = 1024; PathResourceManager resourceManager = new PathResourceManager(base, cacheBufferSize * cacheBuffers, true, false); rootHandler = new AcmeResourceHandler(resourceManager, rootHandler); GateHandlerWrapper gateHandlerWrapper = this.gateHandlerWrapper; if(gateHandlerWrapper != null) { rootHandler = gateHandlerWrapper.wrap(rootHandler); } return rootHandler; }
private HttpHandler configureRootHandler() { AccessLogService logService = accessLogService; HttpHandler rootHandler = pathHandler; ArrayList<UndertowFilter> filters = new ArrayList<>(this.filters); //handle options * requests rootHandler = new OptionsHandler(rootHandler); //handle requests that use the Expect: 100-continue header rootHandler = Handlers.httpContinueRead(rootHandler); rootHandler = LocationService.configureHandlerChain(rootHandler, filters); if (logService != null) { rootHandler = logService.configureAccessLogHandler(rootHandler); } // handle .well-known requests from ACME certificate authorities String path = WildFlySecurityManager.getPropertyPrivileged("jboss.home.dir", "."); Path base; try { base = Paths.get(path).normalize().toRealPath(); } catch (IOException e) { throw new RuntimeException(e); } final int cacheBufferSize = 1024; final int cacheBuffers = 1024; PathResourceManager resourceManager = new PathResourceManager(base, cacheBufferSize * cacheBuffers, true, false); rootHandler = new AcmeResourceHandler(resourceManager, rootHandler); GateHandlerWrapper gateHandlerWrapper = this.gateHandlerWrapper; if(gateHandlerWrapper != null) { rootHandler = gateHandlerWrapper.wrap(rootHandler); } return rootHandler; }
private HttpHandler configureRootHandler() { AccessLogService logService = accessLogService; HttpHandler rootHandler = pathHandler; ArrayList<UndertowFilter> filters = new ArrayList<>(this.filters); //handle options * requests rootHandler = new OptionsHandler(rootHandler); //handle requests that use the Expect: 100-continue header rootHandler = Handlers.httpContinueRead(rootHandler); rootHandler = LocationService.configureHandlerChain(rootHandler, filters); if (logService != null) { rootHandler = logService.configureAccessLogHandler(rootHandler); } // handle .well-known requests from ACME certificate authorities String path = WildFlySecurityManager.getPropertyPrivileged("jboss.home.dir", "."); Path base; try { base = Paths.get(path).normalize().toRealPath(); } catch (IOException e) { throw new RuntimeException(e); } final int cacheBufferSize = 1024; final int cacheBuffers = 1024; PathResourceManager resourceManager = new PathResourceManager(base, cacheBufferSize * cacheBuffers, true, false); rootHandler = new AcmeResourceHandler(resourceManager, rootHandler); GateHandlerWrapper gateHandlerWrapper = this.gateHandlerWrapper; if(gateHandlerWrapper != null) { rootHandler = gateHandlerWrapper.wrap(rootHandler); } return rootHandler; }
@Override protected void doStart() throws Exception { super.doStart(); final UndertowEndpoint endpoint = getEndpoint(); if (endpoint.isWebSocket()) { /* * note that the new CamelWebSocketHandler() we pass to registerEndpoint() does not necessarily have to be * the same instance that is returned from there */ this.webSocketHandler = (CamelWebSocketHandler) endpoint.getComponent().registerEndpoint(endpoint.getHttpHandlerRegistrationInfo(), endpoint.getSslContext(), new CamelWebSocketHandler()); this.webSocketHandler.setConsumer(this); } else { // allow for HTTP 1.1 continue endpoint.getComponent().registerEndpoint(endpoint.getHttpHandlerRegistrationInfo(), endpoint.getSslContext(), Handlers.httpContinueRead( // wrap with EagerFormParsingHandler to enable undertow form parsers new EagerFormParsingHandler().setNext(UndertowConsumer.this))); } }