Skip to content
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

Adding the "user-agent" Header #3720

Merged
merged 5 commits into from
Nov 26, 2019
Merged

Adding the "user-agent" Header #3720

merged 5 commits into from
Nov 26, 2019

Conversation

DarthSett
Copy link
Contributor

@DarthSett DarthSett commented Oct 23, 2019

Added the "user-agent" header with the value: "Scope/1.11.6" and added a test for it.

Fixes #3715.

@bboreham
Copy link
Collaborator

Thanks for the PR!

@DarthSett
Copy link
Contributor Author

I changed it to "Probe_Scope/probeversion". Please review the changes. I have committed and pushed them to my fork.

Copy link
Contributor

@fbarl fbarl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @DarthSett!

Left some small comments, otherwise looks good.

@@ -29,7 +29,7 @@ func dummyServer(t *testing.T, expectedToken, expectedID string, expectedVersion
}

if have := r.Header.Get(xfer.ScopeProbeVersionHeader); expectedVersion != have {
t.Errorf("want %q, have %q", expectedID, have)
t.Errorf("want %q, have %q", expectedVersion, have)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I wonder why the tests were passing before 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also add a similar check here for the user-agent field while you're at it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yea. Sorry forgot to mention this change in the pr

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are passing because this is just the bit that prints out what it found - the check is on the line before.

@DarthSett
Copy link
Contributor Author

I have committed the changes mentioned

@fbarl
Copy link
Contributor

fbarl commented Oct 28, 2019

Thanks @DarthSett, user-agent header looks good to me now.

Before we merge, could you please add a test for it? See #3720 (comment).

... added a test for it.

So far you've only fixed the existing test for xfer.ScopeProbeVersionHeader, but it would be nice to do the same check for user-agent ;)

@DarthSett
Copy link
Contributor Author

@fbarl Added the check for user-agent and pushed it to the fork. Please review if it looks good or not

Copy link
Collaborator

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bboreham bboreham merged commit 5ebe9b4 into weaveworks:master Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scope probe should set the user-agent string
3 participants