public void messageReceived(ChannelHandlerContext context, MessageEvent e) throws Exception {
HttpRequest request = (HttpRequest) e.getMessage();
String base = getBaseUri(request);
URI baseUri = new URI(base);
URI requestUri = new URI(base.substring(0, base.length() - 1) + request.getUri());
ContainerRequest cRequest = new ContainerRequest(application, request
.getMethod().getName(), baseUri, requestUri,
getHeaders(request), new ChannelBufferInputStream(
request.getContent()));
application.handleRequest(cRequest, new Writer(e.getChannel()));
}