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

Fix Grape allowing invalid headers to be set #2511

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Commits on Nov 15, 2024

  1. Fix Grape allowing invalid headers to be set

    Fixes ruby-grape#2334
    
    Ensure all header values are strings according to the Rack spec.
    
    * Convert header values to strings using `to_s` in the `header` method in `lib/grape/dsl/headers.rb`.
    * Emit a warning if the header value is not a string in the `header` method in `lib/grape/dsl/headers.rb`.
    * Add tests in `spec/grape/dsl/headers_spec.rb` to verify that non-string header values are converted to strings and warnings are emitted.
    
    ---
    
    For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/ruby-grape/grape/issues/2334?shareId=XXXX-XXXX-XXXX-XXXX).
    SlakrHakr committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    c392284 View commit details
    Browse the repository at this point in the history
  2. appease rubocop

    SlakrHakr committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    7f5e53a View commit details
    Browse the repository at this point in the history
  3. fix test

    SlakrHakr committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    6ffceb5 View commit details
    Browse the repository at this point in the history
  4. Update endpoint.rb

    SlakrHakr authored Nov 15, 2024
    Configuration menu
    Copy the full SHA
    159a2df View commit details
    Browse the repository at this point in the history
  5. Update endpoint.rb

    SlakrHakr authored Nov 15, 2024
    Configuration menu
    Copy the full SHA
    d18cdfc View commit details
    Browse the repository at this point in the history
  6. add documentation

    SlakrHakr committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    d3ed93a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fa8eb12 View commit details
    Browse the repository at this point in the history
  8. added info to upgrading doc

    SlakrHakr committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    761a7e6 View commit details
    Browse the repository at this point in the history