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

Add Rack::Lint to ActionDispatch::Callbacks tests #48810

Merged
merged 1 commit into from Jul 27, 2023

Conversation

nunosilva800
Copy link
Contributor

@nunosilva800 nunosilva800 commented Jul 26, 2023

Motivation / Background

To ensure Rails is and remains compliant with the Rack 3 spec we can add Rack::Lint to the Rails middleware tests.

This adds additional test coverage for ActionDispatch::Callbacks by validating that its input and output follow the Rack SPEC.

Detail

ActionDispatch::Callbacks makes no changes to the input or output of the Rack app itself, so these tests are trivial.

Additional information

The "rack.input" => StringIO.new("") header value raised the following error:

Rack::Lint::LintError: rack.input #<StringIO:0x00007fd7513fe550> does not have ASCII-8BIT as its external encoding

Since this header is not required for the test, it is now removed.

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.

This adds additional test coverage for ActionDispatch::Callbacks by
validating that its input and output follow the Rack SPEC.

The `"rack.input" => StringIO.new("")` header value raised the following error:

```
Rack::Lint::LintError: rack.input #<StringIO:0x00007fd7513fe550> does not have ASCII-8BIT as its external encoding
```

Since this header is not required for the test, it is now removed.
@rails-bot rails-bot bot added the actionpack label Jul 26, 2023
@eileencodes eileencodes merged commit 6f39611 into rails:main Jul 27, 2023
9 checks passed
@nunosilva800 nunosilva800 deleted the ns-rack-lint-callbacks branch July 28, 2023 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants