I have a project with a C# client and a C# (ASP.NET Web API) backend. Earlier this year the client was able to talk to the backend without specifying a User-Agent HTTP header, but at some point this mysteriously stopped working, and I was only able to fix it after much experimentation, by specifying a User-Agent header in the client.
Unfortunately I have a 2nd client which I don’t control, which needs to talk to my backend. It was also working and is also now failing and I’m guessing it’s because it doesn’t specify the User-Agent.
The error I get in both cases is “An error occurred while sending the request.”, inner exception “The response ended prematurely.”. (Well I’m guessing as to the inner exception in the case of the client I don’t control).
The backend is running on Nginx in a docker container on a Linux host. I don’t know which level is requiring User-Agent.
How can I modify my backend to not require User-Agent?
2