All project content is available for reading, but you need to be a member of the project for Subversion checkout of source code, or to create/modify any information.
Login if you are a member. Apply here to request membership (open to all).

Ticket #351 (new enhancement)

Opened 9 years ago

Last modified 9 years ago

Move IgnoredResourceExtensions to web.config?

Reported by: thomas@… Owned by: permagne@…
Priority: minor Component: 404Handler
Keywords: Cc: fmsftst@…


We have a lot of requests to http://mypage.no/resorce.jpg.img, and I want to add ".img" to the ignoredResourceExtensions (wich is a private, static, readonly List<string>. Can this be moved to configuration?


  • add IgnoredResourceExtensions to configurationsection (via configuration section designer, as a simple comma-seperated string)
  • minor changes in Custom404Handler to check if IgnoredResourceExtensions is set in web.config, if not, default values are used

and BVNetwork.FileNotFound.Handler.CustomFileNotFoundHandler:

private static readonly List<string> DEF_IGNOREDRESOURCEEXTENSIONS = new List<string>() { "jpg", "gif", "png", "css", "js", "ico", "swf" };
/// <summary>

/// Returns a list of ignored resource extensions. Default values if nothing is specified in web.config: "jpg,gif,png,css,js,ico,swf"

/// </summary>

public static List<string> IgnoredResourceExtensions




        if (Bvn404HandlerConfiguration.Instance != null && !string.IsNullOrEmpty(Bvn404HandlerConfiguration.Instance.IgnoredResourceExtensions))


            var temp = Bvn404HandlerConfiguration.Instance.IgnoredResourceExtensions.Split(",".ToCharArray()).ToList();

            return temp;




//private static readonly List<string> _ignoredResourceExtensions = new List<string> {"jpg", "gif", "png", "css", "js", "ico", "swf"};
private static List<string> _ignoredResourceExtensions; 

public static List<string> IgnoredResourceExtensions
	get { return _ignoredResourceExtensions ?? (_ignoredResourceExtensions = Configuration.Configuration.IgnoredResourceExtensions); }

Change History

comment:1 Changed 9 years ago by thomas@…

If you want, I can commit the changes above to the 6.x-branch? 

comment:2 Changed 9 years ago by permagne@…

Sure. Sounds reasonable.

Note: See HelpUser/Tickets for help on using tickets.