@Override public String getMethodValue() { return this.request.method().name(); }
@Override public String getMethodValue() { return this.request.method().name(); }
@Override public String getMethodValue() { return this.request.method().name(); }
@Override public String getMethodValue() { return this.request.method().name(); }
@Override public boolean test(HttpServerRequest key) { return (method == null || method.equals(key.method())) && key.uri() .startsWith( prefix); } }
@Override public boolean test(HttpServerRequest key) { return (method == null || method.equals(key.method())) && key.uri() .startsWith( prefix); } }
@Override public final boolean test(HttpServerRequest key) { return (protocol == null || protocol.equals(key.version())) && (method == null || method.equals( key.method())) && (template == null || template.matches(key.uri())); }
@Override public final boolean test(HttpServerRequest key) { return (protocol == null || protocol.equals(key.version())) && (method == null || method.equals( key.method())) && (template == null || template.matches(key.uri())); }
@Override public Publisher<Void> apply(HttpServerRequest httpRequest, HttpServerResponse httpResponse) { LOGGER.debug( "Accepted request: {}, headers: {}, params: {}", httpRequest, httpRequest.requestHeaders(), httpRequest.params()); if (httpRequest.method() != POST) { LOGGER.error("Unsupported HTTP method. Expected POST, actual {}", httpRequest.method()); return methodNotAllowed(httpResponse); } return httpRequest .receive() .aggregate() .map(ByteBuf::retain) .doOnNext(content -> metrics.markRequest()) .flatMap(content -> handleRequest(content, httpRequest, httpResponse)) .doOnSuccess(avoid -> metrics.markResponse()) .onErrorResume(t -> error(httpResponse, DefaultErrorMapper.INSTANCE.toMessage(t))); }
@Override public Publisher<Void> apply(HttpServerRequest httpRequest, HttpServerResponse httpResponse) { LOGGER.debug( "Accepted request: {}, headers: {}, params: {}", httpRequest, httpRequest.requestHeaders(), httpRequest.params()); if (httpRequest.method() != POST) { LOGGER.error("Unsupported HTTP method. Expected POST, actual {}", httpRequest.method()); return methodNotAllowed(httpResponse); } return httpRequest .receive() .aggregate() .map(ByteBuf::retain) .doOnNext(content -> metrics.markRequest()) .flatMap(content -> handleRequest(content, httpRequest, httpResponse)) .doOnSuccess(avoid -> metrics.markResponse()) .onErrorResume(t -> error(httpResponse, ExceptionProcessor.toMessage(t))); }
.handle((req, res) -> { if (req.uri().contains("/login") && req.method().equals(HttpMethod.POST) && counter.getAndDecrement() > 0) { return res.sendRedirect(url);