Skip to content

async handler for proxyReqWs #1403

Description

@LiranBri

Hello,
Because proxyReqWs event is fired by event emitter [code], it does not support any async handling by returning a promise.

When someone tries to provide an async function handler that modifies headers, it results by an exception that the headers are modified AFTER the response has been sent.

Its big brother, proxyReq, has no such problem.

Is there any workaround or suggested way to make a modification that involves async operation?

if not, I would suggest such a feature.. even though it might require changing how the mechanism works (top of my head: optional parameters such as "next" + configuration to hint its async somehow).

Moreover, I would suggest to explicitly document the fact that an async handler is not allowed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions