Skip to content

Problem when testing with server.inject #2030

@osukaa

Description

@osukaa

Hi! I'm trying to test with Lab my reverse proxy. So I make a server.inject but it replies 500, I started to put console.log around the code and discovered that when the code reaches the OnResponse method I have, it returns from the inject and into the callback:

server.inject('route/to/call',function(res){
console.log('this gets called before the Wreck.read');
}
function OnResponse(err,res,request,reply,settings,ttl){
console.log('this is printed before the callback');
Wreck.read(res,null,function(err,payload){
    console.log('this gets called after the inject callback finishes');
}
}

Metadata

Metadata

Assignees

Labels

non issueIssue is not a problem or requires changes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions