Skip to content

selfHandleResponse: true => response broken #1263

@HugoMuller

Description

@HugoMuller

I'm trying to manually handle the response with { selfHandleResponse: true }, but, as the doc says:

none of the webOutgoing passes are called

And that prevents me from correctly sending response.

This is the code causing the problem:

// passes/web-incoming.js
if(!res.headersSent && !options.selfHandleResponse) {
  for(var i=0; i < web_o.length; i++) {
    if(web_o[i](req, res, proxyRes, options)) { break; }
  }
}

Doing this, fixes it:

if(!res.headersSent) {
  for(var i=0; i < web_o.length; i++) {
    if(web_o[i](req, res, proxyRes, options)) { break; }
  }
}

I need to call the webOutgoing passes and do some extra stuff. But I can't.
Maybe you can expose passes/web-outgoing, or add a flag like callWebOutgoing to let users call them if they want to.

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