currentRequestPath = new QueryStringDecoder(currentRequest.getUri(), ENCODING).path(); currentDecoder = new HttpPostRequestDecoder(DATA_FACTORY, currentRequest, ENCODING);
public String getPath() { return queryStringDecoder.path(); }
public String getPath() { return queryStringDecoder.path(); }
/** * Returns allowed methods for a specific URI. * * <p>For {@code OPTIONS *}, use {@link #allAllowedMethods()} instead of this method. */ public Set<HttpMethod> allowedMethods(String uri) { QueryStringDecoder decoder = new QueryStringDecoder(uri); String[] tokens = PathPattern.removeSlashesAtBothEnds(decoder.path()).split("/"); if (anyMethodRouter.anyMatched(tokens)) { return allAllowedMethods(); } Set<HttpMethod> ret = new HashSet<HttpMethod>(routers.size()); for (Map.Entry<HttpMethod, MethodlessRouter<T>> entry : routers.entrySet()) { MethodlessRouter<T> router = entry.getValue(); if (router.anyMatched(tokens)) { HttpMethod method = entry.getKey(); ret.add(method); } } return ret; }
/** * Returns allowed methods for a specific URI. * * <p>For {@code OPTIONS *}, use {@link #allAllowedMethods()} instead of this method. */ public Set<HttpMethod> allowedMethods(String uri) { QueryStringDecoder decoder = new QueryStringDecoder(uri); String[] tokens = PathPattern.removeSlashesAtBothEnds(decoder.path()).split("/"); if (anyMethodRouter.anyMatched(tokens)) { return allAllowedMethods(); } Set<HttpMethod> ret = new HashSet<HttpMethod>(routers.size()); for (Map.Entry<HttpMethod, MethodlessRouter<T>> entry : routers.entrySet()) { MethodlessRouter<T> router = entry.getValue(); if (router.anyMatched(tokens)) { HttpMethod method = entry.getKey(); ret.add(method); } } return ret; }
@Override protected void channelRead0(ChannelHandlerContext channelHandlerContext, HttpRequest httpRequest) { if (HttpHeaders.is100ContinueExpected(httpRequest)) { channelHandlerContext.writeAndFlush(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.CONTINUE)); return; } // Route HttpMethod method = httpRequest.getMethod(); QueryStringDecoder qsd = new QueryStringDecoder(httpRequest.uri()); RouteResult<?> routeResult = router.route(method, qsd.path(), qsd.parameters()); if (routeResult == null) { respondNotFound(channelHandlerContext, httpRequest); return; } routed(channelHandlerContext, routeResult, httpRequest); }
@Override protected void channelRead0(ChannelHandlerContext channelHandlerContext, HttpRequest httpRequest) { if (HttpHeaders.is100ContinueExpected(httpRequest)) { channelHandlerContext.writeAndFlush(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.CONTINUE)); return; } // Route HttpMethod method = httpRequest.getMethod(); QueryStringDecoder qsd = new QueryStringDecoder(httpRequest.uri()); RouteResult<?> routeResult = router.route(method, qsd.path(), qsd.parameters()); if (routeResult == null) { respondNotFound(channelHandlerContext, httpRequest); return; } routed(channelHandlerContext, routeResult, httpRequest); }
currentRequestPath = new QueryStringDecoder(currentRequest.getUri(), ENCODING).path(); currentDecoder = new HttpPostRequestDecoder(DATA_FACTORY, currentRequest, ENCODING);
currentRequestPath = new QueryStringDecoder(currentRequest.getUri(), ENCODING).path(); currentDecoder = new HttpPostRequestDecoder(DATA_FACTORY, currentRequest, ENCODING);