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

Updated User-Agent header logic #87

Merged
merged 2 commits into from
Mar 23, 2021
Merged

Conversation

phriscage
Copy link
Contributor

Issue/Request:

The User-Agent header was not set when passed as a HTTP header param. Added the ability to set User-Agent via header and/or separate CLI parameter -U.

@phriscage phriscage changed the title Update useragent Updated User-Agent header logic Jan 24, 2018
Copy link

@fukuanru fukuanru left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@darynl darynl left a comment

Choose a reason for hiding this comment

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

LGTM

@stefanprodan
Copy link

@rakyll is there any chance to get this merged? Setting the user-agent would allow Flagger load generator service to work for A/B testing scenarios when the test is based on browser/os versions.

Thanks

spk added a commit to spk/hey that referenced this pull request May 30, 2020
on command line the option -H "User-Agent: CustomUserAgent"
is ignored and default user agent is always used
First check if its defined then fallback to default

ref rakyll#87
fix rakyll#157
@rakyll rakyll merged commit 8985827 into rakyll:master Mar 23, 2021
@Dante-dan
Copy link

@rakyll Maybe, you should publish a release version. 😢

@Anpilaot
Copy link

Anpilaot commented Dec 1, 2022

How do I implement the UA update?

I tried to download the repository, but couldn't compile and run the go script.

Is there any release version?

@lindsey-em
Copy link

This update will append the original UA so you end up with something like new ua hey/0.0.1:

// set userAgent header if set
    if *userAgent != "" {
        ua = *userAgent + " " + heyUA
        header.Set("User-Agent", ua)
    }

I just very quickly threw up a fork that will completely replace the UA, with installation instructions in the readme:

https://github.com/lindsey-em/hey

@Anpilaot
Copy link

Anpilaot commented Dec 8, 2022 via email

chunter0 pushed a commit to chunter0/hey that referenced this pull request Apr 8, 2024
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.

None yet

8 participants