httpcontext Class giving path as /:undefined in Asp.Net Core Web API Project

Ali basha Syed 20 Reputation points
2025-03-07T11:12:27.09+00:00

We have an Web API (.Net Core) application installed in Test and PROD server,

we are logging incoming request paths, using httpcontext Class.

But this class is giving path as /:undefined, sometimes as

/struts2-showcase/struts/inputtransfersselect.js,

/struts2-showcase/token/transfer4.action,

/index.action/struts/utils.js etc...

Where as in local, I am getting Path as /swagger/index.html, when I run API in Swagger, which is expected.

Why this is happening, how to avoid these urls hitting our API and resolve this problem. Thanks.

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
393 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 72,026 Reputation points
    2025-03-07T16:48:28.61+00:00

    If you also logged the referer header you might get the source. It likely some webpage.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.