Redirect does not terminate the response, which may be confusing
Open
Nobody has claimed this yet.
discuss!
feature request
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
I got caught by surprise that redirect doesn't terminate the response. Added myself a redirect! like so, but maybe this needs to at least be documented or an option added to stop the response:
module Grape
module Extensions
module RedirectExtension
def redirect!(url, options = {})
redirect url, options
throw :error, status: @status, headers: @header
end
Grape::Endpoint.send(:include, self)
end
end
end
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Grape's redirect implementation and the response termination path; the issue does not name files or tests. Compare the current redirect behavior with the proposed RedirectExtension example, then establish whether the accepted outcome is documentation or an optional terminating redirect and add coverage showing when the response stops.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100