Skip to content

Fix net http request on ruby 2.7 #130

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

Merged
merged 2 commits into from
Jun 18, 2022

Conversation

cover
Copy link
Contributor

@cover cover commented May 22, 2022

I've just noticed that #109 isn't working under 2.7 (my bad on not trying that version locally and thinking that it'd run on CI before getting merged 😬 🤦‍♂️).

The reason is that Ruby 3.0 added the ability to set headers on the Net::HTTP.get call, while 2.7 doesn't have that, and so it breaks.

This fixes that by changing the Get request.

I've tried and the Content-Type header is not required by the NPM server (so a simple Net::HTTP.get(uri) would work), but I prefer sending it just to be future-proof in case they'll require it.

I've also added a couple of lines to the Readme to mention the two new commands.

It might be worth releasing a v1.1.1 with this fix. Sorry for the trouble 😅

/cc @dhh

@dhh dhh merged commit 055ebd3 into rails:main Jun 18, 2022
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.

2 participants