If you request a url for a /picture1.aaa image that is not available you get a 404 status returned with nopcommerce 'Page Not Found' content:
Is this expected behaviour? Personally, I would expect the 404 to be returned with nopcommerce 'Page Not Found' content in both cases.
This happens because of the setup in ApplicationBuilderExtensions.UsePageNotFound():
public static void UsePageNotFound(this IApplicationBuilder application)
{
application.UseStatusCodePages(async context =>
{
//handle 404 Not Found
if (context.HttpContext.Response.StatusCode == StatusCodes.Status404NotFound)
{
var webHelper = EngineContext.Current.Resolve<IWebHelper>();
if (!webHelper.IsStaticResource())
{
...
//get new path
context.HttpContext.Request.Path = "/page-not-found";
The webHelper.IsStaticResource() determines if the resource is static by calling FileExtensionContentTypeProvider.TryGetContentType(String, String) to determine if the MIME type is recognised.
Do we need this check? We know that we already have a 404 from the inital status code check so why not skip the MIME type check and display the Page Not Found content in all cases?