Fix CI Failures by Adding User-Agent Header to node:https get method#76
Closed
Henry-Hong wants to merge 2 commits intoalexeyraspopov:mainfrom
Closed
Fix CI Failures by Adding User-Agent Header to node:https get method#76Henry-Hong wants to merge 2 commits intoalexeyraspopov:mainfrom
node:https get method#76Henry-Hong wants to merge 2 commits intoalexeyraspopov:mainfrom
Conversation
node:https get method
styfle
pushed a commit
to styfle/packagephobia
that referenced
this pull request
Aug 3, 2024
Hi 👋 This PR adds [picocolors](https://github.com/alexeyraspopov/picocolors) to the list As you can see, picocolors using API from packagephobia but get `Forbidden` error because of API block policy. And don't worry. I set appropriate user-agent header too [here](alexeyraspopov/picocolors#76). <img width="755" alt="image" src="https://github.com/user-attachments/assets/4043866a-9d9f-47bb-8b85-0194e139ded8">
styfle
reviewed
Aug 8, 2024
benchmarks/size.js
Outdated
| async function getJSON(url) { | ||
| return new Promise(resolve => { | ||
| get(url, res => { | ||
| get(url, { headers: {"user-agent": 'picocolors'} },res => { |
There was a problem hiding this comment.
Suggested change
| get(url, { headers: {"user-agent": 'picocolors'} },res => { | |
| get(url, { headers: {"user-agent": 'picocolors-size-benchmark'} },res => { |
Let’s be more specific since picocolors doesn’t make API calls during runtime, only during this benchmark.
Contributor
Author
There was a problem hiding this comment.
That make sense. Here's commit you ordered! 6285808
Contributor
Author
There was a problem hiding this comment.
Sorry to tag you, but can you check this PR please? Thanks.
styfle
added a commit
to styfle/packagephobia
that referenced
this pull request
Aug 10, 2024
as-is : picocolors to-be : picocolors-size-benchmark Changed name since picocolors use API call only when size benchmark. Thanks! related : alexeyraspopov/picocolors#76 --------- Co-authored-by: Steven <steven@ceriously.com>
styfle
approved these changes
Aug 18, 2024
Owner
|
Looks like bundlephobia no longer available as dedicated API. I reworked the size benchmark in #86 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
benchmark.yamlis trying to send requests to the Bundlephobia API. However, their policy has changed, and they are now enforcing a whitelist policy."user-agent : picocolors"as follows.