Home » IIS » Case-sensitive URLs cause issues with IIS Static File module

Case-sensitive URLs cause issues with IIS Static File module

If you have third-party software that receives data (such as URLs) from IIS, case sensitivity may cause issues.

For an issue I troubleshoot, the Cohesity storage system received file names from IIS through CIFS. Their storage system (third-party) uses case-sensitive file names. For example: file.jpg and FILE.jpg can exist in the same folder.

However, IIS static module and Windows are case-insensitive. When IIS sends the request to their storage system, It doesn’t transmit the file name as is. Therefore, no matter if the application wants to fetch file.jpg or FILE.jpg, IIS uses the same casing for both. This may result in “File not found” error if the casing of the file name doesn’t match with the casing of the file name on the storage.

You may ask why IIS treats URLs as case-insensitive while RFC 7230 says the parts of the URL except the scheme and host are case-sensitive.

From the RFC 7230:

The scheme and host are case-insensitive and normally provided in lowercase; all other components are compared in a case-sensitive manner.

Case-insensitive URLs in IIS

IIS reserves the case in request URL (Failed Request Tracing shows the case correctly). However, if you are using IIS static file module, the URLs become case-insensitive. This module uses IHttpFileInfo Interface for caching. IHttpFileInfo interface converts filename to uppercase. As a result, the file name could be different than the requested URL.

IIS static file module’s behavior matches with Windows file system behavior which is also case-insensitive (Reference).

The behavior of IIS static file module is not considered as a bug by Microsoft. Therefore, there is unlikely to be a change in regards to case sensitivity for IIS static module.

Ned Sahin

Blogger for 20 years. Former Microsoft Engineer. Author of six books. I love creating helpful content and sharing with the world. Reach me out for any questions or feedback.
Categories IIS

Leave a Comment