1
Vote

not process files with an querystring, like img src="handler.ashx?id=123"

description

try to modify source of combineFile.cs, but i dont know if it is correct
 
    public static string MapPath(string url, bool throwExceptionOnMissingFile)
    {
        HttpContext currentContext = HttpContext.Current;
        HttpServerUtility hsu = currentContext.Server;
        string filePath = null;
 
        if (url.IndexOf('?') < 0)
        {
            try
            {
                filePath = hsu.MapPath(url);
            }
            catch (InvalidOperationException)
            {
                if (url.StartsWith("/"))
                {
                    try
                    {
                        string urlTilde = "~" + url;
                        string resolvedUrl = ResolveUrl(urlTilde);
                        filePath = hsu.MapPath(resolvedUrl);
                    }
                    catch (InvalidOperationException)
                    {
                    }
                }
            }
            catch (HttpException)
            {
                // You get this exception when the url contains a domain or when it starts with "..".
                string absoluteUrl = new Uri(url).AbsolutePath;
                string urlTilde = "~" + absoluteUrl;
                string resolvedUrl = ResolveUrl(urlTilde);
                filePath = hsu.MapPath(resolvedUrl);
            }
        }

comments