Valid ASPX file extensions

Topics: Web Client Software Factory
Jan 8, 2007 at 1:00 AM
I don't think the way the IsAspxPage is implement is a good solution.

Taking all extensions registered with the "System.Web.UI.PageHandlerFactory" string seems like a good start but might not be good enough.

A likeable solution would be to parse all pages registered in the page flow and check for them instead of just terminations. But that could take a big set up time on the start of the application.

Probably, the best solution would be to have a configuration section for registering file extensions.
Coordinator
Jan 8, 2007 at 4:32 AM
Check out what we did in today's drop, and let us know if you think it is workable.
Jan 8, 2007 at 10:36 AM
It's still another name for the same thing but in the right direction.

My suggestion is adding support in the configuration file to add custom extensions to the list of valid extensions.

The stored extensions should be converted to lower case characters before being added to the list to prevent conversion in every comparison.

The IsHandledByPageHandlerFactory should be done to HttpRequest.AppRelativeCurrentExecutionFilePath instead of HttpRequest.RawUrl to prevent validating URLs that have URLs as query string parameters. By testing HttpRequest.AppRelativeCurrentExecutionFilePath, the test should be String.EndsWith.