Shouldn't MVC ignore images by default?

后端 未结 1 1575
南笙
南笙 2021-01-14 16:24

If there is 1.jpg image, so it is downloaded and showed


But, if there is no 1.

相关标签:
1条回答
  • 2021-01-14 16:44

    That's actually handled by your hosting environment/web server, not by MVC per-se.

    I suspect you are using the Visual Studio Web Server during development, right? The Visual Studio Web Server does not handle these requests by default.

    If you host your project with IIS, IIS will take care of this. IIS will intercept the request to a JPG and handle it rather than letting hit your code. But the Visual Studio Web Server does not.

    It's not uncommon to have the ignore route that you mentioned because a lot of people develop with the VS Web Server.

    0 讨论(0)
提交回复
热议问题