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

Disable setting default user-agent #1495

Merged
merged 1 commit into from
Jun 15, 2019
Merged

Disable setting default user-agent #1495

merged 1 commit into from
Jun 15, 2019

Conversation

apoorv-mishra
Copy link
Contributor

Fixes #1479

@niftylettuce
Copy link
Collaborator

Can you please fix the tests @apoorv-mishra?

Revert "Disable setting default user-agent"

This reverts commit 01841cc6fc2e5884b2259bf369d0ffba8d5618c1.

Disable setting default user-agent

Remove unused var
@apoorv-mishra
Copy link
Contributor Author

@niftylettuce Updated.

@niftylettuce niftylettuce merged commit e652b8c into ladjs:master Jun 15, 2019
@niftylettuce
Copy link
Collaborator

I've released this as v5.1.0 to npm, it has a minor version bump because existing users may have issues with the user-agent being stripped in this version.

npm install superagent@latest

https://github.com/visionmedia/superagent/releases/tag/v5.1.0

@wyardley
Copy link

IMHO, this would have been better as a breaking / major change.
Certain sites (GitHub, for example) will reject requests sent without a User-Agent header.

@comster
Copy link

comster commented Oct 3, 2019

IMHO, this would have been better as a breaking / major change.
Certain sites (GitHub, for example) will reject requests sent without a User-Agent header.

For instance this does break https://github.com/lambtron/get-stargazers-emails - FWIW

lfdebrux added a commit to alphagov/govuk-prototype-kit that referenced this pull request Dec 16, 2021
Previously we were relying on VERSION.txt for the name of the latest
release, however this doesn't work in scenarios where we have changed
the version number in preperation but have not yet made the release, as
we found recently (see issue #1205).

Instead we get the latest release version using the GitHub API [[1]].
Note that we have to drop the `v` at the beginning of the tag name,
because for some reason GitHub doesn't include that in the archive file
name.

This commit uses the `superagent` library to do the request to avoid a
lot of boilerplate; note that we have to set the user agent to
something, because otherwise GitHub will forbid the request [[2]].

[1]: #1205 (comment)
[2]: ladjs/superagent#1495 (comment)
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.

how to avoid sending user-agent header?
4 participants