use of com.nike.riposte.server.http.Endpoint in project riposte by Nike-Inc.
the class RoutingHandler method doChannelRead.
@Override
public PipelineContinuationBehavior doChannelRead(ChannelHandlerContext ctx, Object msg) {
if (msg instanceof HttpRequest) {
HttpRequest nettyRequest = (HttpRequest) msg;
HttpProcessingState state = ChannelAttributes.getHttpProcessingStateForChannel(ctx).get();
RequestInfo request = handlerUtils.createRequestInfoFromNettyHttpRequestAndHandleStateSetupIfNecessary(nettyRequest, state);
// If the Netty HttpRequest is invalid, we shouldn't do any endpoint routing.
handlerUtils.throwExceptionIfNotSuccessfullyDecoded(nettyRequest);
// The HttpRequest is valid, so continue with the endpoint routing.
Pair<Endpoint<?>, String> endpointForExecution = findSingleEndpointForExecution(request);
request.setPathParamsBasedOnPathTemplate(endpointForExecution.getRight());
state.setEndpointForExecution(endpointForExecution.getLeft(), endpointForExecution.getRight());
handleSpanNameUpdateForRequestWithPathTemplate(nettyRequest, request, state);
throwExceptionIfContentLengthHeaderIsLargerThanConfiguredMaxRequestSize(nettyRequest, endpointForExecution.getLeft());
}
return PipelineContinuationBehavior.CONTINUE;
}
Aggregations