1
Vote

correct handle data: in urls

description

I try to modify source of FileTypeUtilities.cs, but i dont know the consequences in rest of source...
 
    public enum FileType
    {
        CSS,
        JavaScript,
        Jpeg,
        Png,
        Gif,
        Woff,
        Ttf,
        Svg,
        Eot,
        Data
    }
   ......
    public static FileType FileTypeOfUrl(string url)
    {
        if (url.ToLower ().StartsWith ("data:"))
        {
            return FileType.Data;
        }
 
        int idxExtension = url.LastIndexOf('.');
 
        if (idxExtension == -1)
        {
            throw new Exception("FileTypeOfUrl - cannot find extension in: " + url);            
        }
       ......

comments