In live site, a lot of http 500 errors are logged from ImageProcessor. The error says "System.InvalidOperationException: Target width 0 and height 0 must be greater than zero." But this is not raised during normal application usage as the image request URL's are correctly formed. Errors are logged from wrongly formed URL's like "https://www.abc.com/globalassets/new-website/privacy-policy/privacy-policy-banner.jpg?format=webp&width=1920|netstat&mode=crop&heightratio=0.5625&quality=80". I noticed the word "netstat" is getting added to the request URL! If I remove "netstat" ,the URL works fine. This malformed URL from unknown source is causing a lot of 500 errors being logged in production. Any help on this?
There are also URL's logged in the format as given below which seems very strange.
Have you looked into application insights?
In application insights you should be able to trace the request is causing the 500 error.
By you description of the issue, it sounds like something is rewriting the url, however without logs / telemetry data.
Another probably is that this is an old url and you just need to handle it better.