Closed abatishchev closed 2 years ago
What's the request, something like OPTIONS * HTTP/1.1
where the * ended up in the path? These old frameworks didn't support those kinds of requests. You should be able to filter them out with middleware like:
app.Use((context, next) =>
{
if (string.Equals(context["owin.RequestPath"], "*"))
{
context.Response.StatusCode = 400;
return Task.FromResult(0);
}
return next();
});
I'm not sure unfortunately what's the exact request. The service is old, not modern and doesn't log failed requests such as these.
What would work better:
string.Equals(context.Request.Path.Value, "*", StringComparison.InvariantCulture)
or
string.Equals((string)context.Environment["owin.RequestPath"], "*", StringComparison.InvariantCulture)
You can't use Request.Path without triggering the same exception as above, you'll need to read the Environment path key directly.
Stack trace:
and
Environment:
Packages: