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

feat: inject deck version into User-Agent header #652

Merged
merged 1 commit into from
Apr 22, 2022
Merged

Conversation

GGabriele
Copy link
Collaborator

@GGabriele GGabriele commented Apr 21, 2022

Before this change:

$ deck ping

<-- kong logs -->

172.19.0.1 - "GET / HTTP/1.1" 200 17479 "-" "Go-http-client/1.1"

After this change:

$ deck ping

<-- kong logs -->

172.19.0.1 - "GET / HTTP/1.1" 200 17479 "-" "decK/v1.11.0"

Copy link
Member

@hbagdi hbagdi left a comment

Choose a reason for hiding this comment

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

Please merge after resolving the comment.

cmd/root.go Outdated

func extendHeaders(headers []string) []string {
userAgentHeader := fmt.Sprintf(
"User-Agent:decK/%s (%s) %s", VERSION, COMMIT, runtime.Version(),
Copy link
Member

Choose a reason for hiding this comment

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

Can we skip COMMIT for now?

Suggested change
"User-Agent:decK/%s (%s) %s", VERSION, COMMIT, runtime.Version(),
"User-Agent:decK/%s", VERSION,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2022

Codecov Report

Merging #652 (db53958) into main (1fe60ed) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #652      +/-   ##
==========================================
- Coverage   44.39%   44.37%   -0.03%     
==========================================
  Files          74       74              
  Lines        8774     8778       +4     
==========================================
  Hits         3895     3895              
- Misses       4518     4522       +4     
  Partials      361      361              
Impacted Files Coverage Δ
cmd/root.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1fe60ed...db53958. Read the comment docs.

Before this change:

```
$ deck ping

<-- kong logs -->

172.19.0.1 - "GET / HTTP/1.1" 200 17479 "-" "Go-http-client/1.1"
```

After this change:

```
$ deck ping

<-- kong logs -->

172.19.0.1 - "GET / HTTP/1.1" 200 17479 "-" "decK/v1.11.0"
```
@GGabriele GGabriele changed the title feat: inject deck and go versions into User-Agent header feat: inject deck version into User-Agent header Apr 22, 2022
@GGabriele GGabriele merged commit 4050c7f into main Apr 22, 2022
@GGabriele GGabriele deleted the user_agent branch April 22, 2022 06:22
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.

3 participants