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

Default gemfile generator to puma >= 6.0 #49825

Closed
wants to merge 1 commit into from
Closed

Conversation

jch
Copy link
Contributor

@jch jch commented Oct 28, 2023

Puma 5.x is not compatible with Rack 3 cookies. The current default new Gemfile uses puma ">= 5.0". Puma ~> 5.6 will error on start when used with Rack 3, but earlier versions will not.

puma/puma#3164: Support Rack 3 cookies
puma/puma#3166: Prevent loading with rack 3
phusion/passenger#2503: Related passenger issue detailing cookie error

Motivation / Background

This Pull Request has been created because new Rails apps can install versions of Puma which will silently set cookies incorrectly if used with rack 3.x

Detail

This Pull Request changes the base generator to default to puma >= 6.0

Additional information

Based on puma/puma#3164, would it make sense to backport this back to Rails 6.1?
/cc @JoeDupuis as original author on the puma side

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Puma 5.x is not compatible with Rack 3 cookies. The current default
new Gemfile uses puma ">= 5.0". Puma ~> 5.6 will error
on start when used with Rack 3, but earlier versions will not.

puma/puma#3164: Support Rack 3 cookies
puma/puma#3166: Prevent loading with rack 3
phusion/passenger#2503: Related passenger ex
@rails-bot rails-bot bot added the railties label Oct 28, 2023
@zzak
Copy link
Member

zzak commented Oct 30, 2023

This is kind of similar to #49224, and I think it's true that edge Rails still supports Rack 2.

When running rails new, I get both rack 3.0.8 and puma 6.4.0, so I think there is no issue here.

Please correct me if I'm misunderstanding. 🙇

@zzak zzak closed this Oct 30, 2023
@jch
Copy link
Contributor Author

jch commented Oct 30, 2023

Looks like my issue was fixed in main 10/16/22 545a990 when the puma version constraint changed from ~> 5.0 to >= 5.0. Rails 6.1.0 was released 12/9/2020, so the cookie issue exists for any projects created between 12/9/2020 rails 6.1.0 to 01/17/2023 rails 6.1.7.1

+1 this won't impact new projects going forward 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants