-
Notifications
You must be signed in to change notification settings - Fork 373
Closed
Labels
Description
Describe the bug
Affected code-generator: csharp-restsharp
The problem is clearly described in this issue of RestSharp: restsharp/RestSharp#787
In a nutshell, the code-generator currently sets the User-Agent like this:
request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0");But it's not effective at all, see issue referenced above. The solution is from the same issue as well. The correct way to set it is on the client level, like this:
client.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0"To Reproduce
Generate C# code for a request where the User-Agent header is set, then execute the generated code. Observe that the User-Agent is set to RestSharp x.x.x.x instead of the one in the generated code.
Reactions are currently unavailable