public void Parse_IncludeTagWithVariable_IncludeFragmentWithVariableReturned() { var fragment = Parse(@"<esi:include src=""http://host/fragment?referer=$(HTTP_REFERER)""/>"); var expected = new EsiIncludeFragment(new VariableString(new object[] { "http://host/fragment?referer=", new SimpleVariableExpression("HTTP_REFERER") })); fragment.ShouldDeepEqual(expected); }
public IEsiFragment Handle(IReadOnlyDictionary <string, string> attributes, string body, ParseDelegate next) { var fragment = next(attributes, body); if (fragment is EsiIncludeFragment includeFragment) { fragment = new EsiIncludeFragment( new VariableString( includeFragment.Url.Parts.Append("?a=1").ToList())); } return(fragment); }