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

Set a custom user agent string for http checks #882

Closed
fbartels opened this issue Mar 11, 2024 · 4 comments · Fixed by #892
Closed

Set a custom user agent string for http checks #882

fbartels opened this issue Mar 11, 2024 · 4 comments · Fixed by #892

Comments

@fbartels
Copy link
Contributor

Describe the feature:

  • currently when goss performs a http check like below, "Go-http-client/1.1" will be sent to the server as the user agent
http:
  https://www.google.com:
    status: 200
    allow-insecure: false
    no-follow-redirects: false
    timeout: 1000
    username: ""
    password: ""
    ca-file: ""
    cert-file: ""
    key-file: ""
    proxy: ""
    skip: false
    method: GET

Describe the solution you'd like

  • either goss should set its own user agent (like goss/0.4.4) or allow overriding the user agent on a per check basis

Describe alternatives you've considered

  • none
@aelsabbahy
Copy link
Member

Make sense, marked as approved. Feel free to submit a PR if you're interested in the change otherwise, I'll eventually get around to it.

@catdevman
Copy link
Contributor

I'm going to take a shot at this if no one else is already working on it.

@catdevman
Copy link
Contributor

@fbartels just FYI you can override this on a per check basis.

http:
  https://www.google.com:
    status: 200
    allow-insecure: false
    no-follow-redirects: false
    timeout: 1000
    username: ""
    password: ""
    ca-file: ""
    cert-file: ""
    key-file: ""
    proxy: ""
    skip: false
    method: GET
    request-headers:
        - 'user-agent: whatever/you/want/goes/here'

@fbartels
Copy link
Contributor Author

@catdevman thanks or the hint regarding request-headers. I did miss that setting custom headers is already possible in http checks. I can confirm that this works as a workaround until goss sets a proper user-agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants