restify / restify/node-restify

res.redirect unusable in async route handler.

Open
#1,916 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.7k
Forks
975
Avg merge
1d 6h
Merged PRs (30d)
5

Description

  • Used appropriate template for the issue type
  • Searched both open and closed issues for duplicates of this issue
  • Title adequately and concisely reflects the feature or the bug

Restify Version: 9.0.0-rc.3
Node.js Version: v16.13.0

Expected behaviour

Redirect shouldn't need the next callback parameter anymore.

Actual behaviour

Impossible to use res.redirect from an async route handler

Repro case

Call res.redirect from an async route handler

Cause

The direct function requires the next callback function to be passed.

Are you willing and able to fix this?

Yes, but I'm not sure how it should be fixed, or if this is even intentional.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing res.redirect from an async route handler and inspect how the direct function uses the next callback. Reproduce the reported failure with the issue's restify and Node.js versions, then verify that redirect works without requiring next while preserving existing callback behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.