-
Notifications
You must be signed in to change notification settings - Fork 360
Fix csharp-restsharp user agent header issue #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hey @ttzztztz , you need not create a new PR for adding a unit test for the fix. You can add it to your branch and the PR will be updated the latest changes. |
Oh, Got it ! Thank you for your notice! |
Re-run tests. |
@ttzztztz There are some Linting issues. https://travis-ci.com/postmanlabs/postman-code-generators/builds/151242717#L4262 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some lint issues found after running tests needs resolving before this can be merged.
@shreys7 Hello, I updated my codes and it passed the unit test and lint check. Could you please review it again? Thank you! |
@shreys7 Already marked. Thank you for your approval. |
I fixed issue #158 by changing the C# RestSharp API .
As He says, the
doesn't work and will be overwritten to a default UA, the official solution is to use
Instead of Add Header.
So I just fix it by checking whether a Header's key equals to
User-Agent
, If so, output theclient.UserAgent = "..."
, otherwise, output therequest.AddHeader(..., ...)
.So It will work and fix the issues.
@shreys7 I added an extra unit test for my fix. This is my first time contributing to the open source community, thank you for your guidance!