Spring WebFlux блок Http.CONNECT метод

Это также можно контролировать с помощью конфигурации apache. Проверьте httpd.conf и / или .htaccess на что-то вроде следующего:

php_value upload_max_filesize 10M
0
задан brebDev 18 January 2019 в 14:37
поделиться

1 ответ

Я создал собственный обработчик http:

public class AppContextPathCompositeHandler extends ContextPathCompositeHandler {

public AppContextPathCompositeHandler(Map<String, ? extends HttpHandler> handlerMap) {
    super(handlerMap);
}

@Override
public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response) {
    if (HttpMethod.CONNECT.name().equals(request.getMethodValue())) {
        response.setStatusCode(HttpStatus.METHOD_NOT_ALLOWED);
        return response.setComplete();
    }

    return super.handle(request, response);
}
}

, и он был настроен так:

@Configuration
public class NettyReactiveWebServerConfig extends NettyReactiveWebServerFactory {
@Value("${server.context-path}")
private String contextPath;

@Override
public WebServer getWebServer(HttpHandler httpHandler) {
    Map<String, HttpHandler> handlerMap = new HashMap<>();
    handlerMap.put(contextPath, httpHandler);
    return super.getWebServer(new AppContextPathCompositeHandler(handlerMap));
}
}
0
ответ дан brebDev 18 January 2019 в 14:37
поделиться
Другие вопросы по тегам:

Похожие вопросы: