-
Notifications
You must be signed in to change notification settings - Fork 45
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
Fix CI Failures by Adding User-Agent Header to node:https get method
#76
Conversation
node:https get method
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">
benchmarks/size.js
Outdated
@@ -6,7 +6,7 @@ let { bold, gray } = require("../picocolors.js") | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That make sense. Here's commit you ordered! 6285808
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to tag you, but can you check this PR please? Thanks.
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>
Looks like bundlephobia no longer available as dedicated API. I reworked the size benchmark in #86 |
Description
benchmark.yaml
is 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.