This branch adds a method that uses only the path component of a URL when attempting to guess the content type based on the "file" extension inferred from URL. Also updated some code where a simpler method meant for files was being used for URLs.
Motivation and Context
URLs with query strings don't end with a type-hinting "file" extension that can help us guess at the associated content type. Unless we base our guess on the URL's path, we can end up failing to guess or even being mislead by the end of the query string.
How Has This Been Tested?
Added new tests to verify that only the path component of the URL is used for guessing the content type.
Description
This branch adds a method that uses only the
path
component of a URL when attempting to guess the content type based on the "file" extension inferred from URL. Also updated some code where a simpler method meant for files was being used for URLs.Motivation and Context
URLs with query strings don't end with a type-hinting "file" extension that can help us guess at the associated content type. Unless we base our guess on the URL's path, we can end up failing to guess or even being mislead by the end of the query string.
How Has This Been Tested?
path
component of the URL is used for guessing the content type.Checklist: