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

Support rack requests in Slack::Events::Request #369

Merged
merged 2 commits into from
Mar 6, 2021

Conversation

wedgex
Copy link
Contributor

@wedgex wedgex commented Mar 5, 2021

The #headers method on a request is implemented by Rails, so in
order for the event request class to support other rack based servers
we can instead look for the headers via #get_header or #env.

Since Rail's requests are an extension of rack requests this will
also work in a Rails app.

Also worth noting that rack's header's are prepended with HTTP_,
upcased, and treats - and _ both as a _. Rails has some logic to
obfuscate this but technically supports both.

The `#headers` method on a request is implemented by Rails, so in
order for the event request class to support other rack based servers
we can instead look for the headers via `#get_header` or `#env`.

Since Rail's requests are an extension of rack requests this will
also work in a Rails app.
@wedgex wedgex force-pushed the support-rack-requests branch from 35e8d57 to 015b389 Compare March 5, 2021 21:15
@wedgex wedgex force-pushed the support-rack-requests branch from 015b389 to 6b27461 Compare March 5, 2021 21:20
@dblock dblock merged commit c08c95f into slack-ruby:master Mar 6, 2021
@wedgex wedgex deleted the support-rack-requests branch March 8, 2021 13:50
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