public virtual void TestDecodePath() { string EscapedPath = "/test%25+1%26%3Dtest?op=OPEN&foo=bar"; string ExpectedPath = "/test%+1&=test"; Configuration conf = new Configuration(); QueryStringDecoder decoder = new QueryStringDecoder(WebHdfsHandler.WebhdfsPrefix + EscapedPath); ParameterParser testParser = new ParameterParser(decoder, conf); NUnit.Framework.Assert.AreEqual(ExpectedPath, testParser.Path()); }
/// <exception cref="System.Exception"/> protected override void ChannelRead0(ChannelHandlerContext ctx, HttpRequest req) { Preconditions.CheckArgument(req.GetUri().StartsWith(WebhdfsPrefix)); QueryStringDecoder queryString = new QueryStringDecoder(req.GetUri()); @params = new ParameterParser(queryString, conf); DataNodeUGIProvider ugiProvider = new DataNodeUGIProvider(@params); ugi = ugiProvider.Ugi(); path = @params.Path(); InjectToken(); ugi.DoAs(new _PrivilegedExceptionAction_110(this, ctx, req)); }