This is a strange error we're seeing sporadically on our website.
The strange thing about this error is it's being thrown in our URL rewritting IHttpModule. The line in question is:
var host = context.Request.Url.Host;
If I record context.Request.Url
when this exception is thrown, it is an empty string.
This rewriting method is only called via our global.asax
file:
void Context_AuthorizeRequest(object sender, EventArgs e)
=> URLRewriting.Process();
What might cause Request.Url.Host
to be empty?
As a side note, we're seeing a lot of other errors being caught on the site that suggest someone is scanning our website with automated tools to discover weaknesses and exploits. I have a feeling this might somehow be related, although I'm unusure as to why Request.Url.Host
would ever be empty.
Second side note, the users IP making this last request is a University network (not unusual for our website).