Open rubinovk opened 5 years ago
Same issue.
I'm having the same issue when I use Express and body-parser to process a post similar to the above.
I triaged the issue a little and found that on this line:
. . . the pendingRequest
doesn't have a handleBody method. It appears in my debugger in VS Code that it is an IncomingMessage
object.
However, when I inspect the object, the handleBody
method is not there (which is the error reported above).
IncomingMessage
is defined in the HybridConnectionHttpsServer.js
file here:
and here's the function that we are looking for:
It's as if there are multiple IncomingMessage classes derived from different sources.
Perhaps this messages needs to be recast or something?
Also, something odd I saw is that this code directly below the IncomingMessage
definition above
is commented out but later, there is code that uses those constants as shown here:
My guess is that if that code is ever hit, it will fail. Being in proximity to this and other comments, I wonder if that commenting out or a related check may have introduced an issue here?
Purely speculation!
Thanks for reporting this issue.
Pull request created for this fix #56
Actual Behavior
var uri = https.createRelayListenUri(ns, path) var server = https.createRelayedServer( { server: uri, token: () => https.createRelayToken(uri, keyrule, key) }, app )
app.post('/my-hc', (req, res) => { console.log('received') res.status(200).send('hey') })
server.listen()
hyco-https\lib\HybridConnectionHttpsServer.js:653 requestChannel.pendingRequest.handleBody(event.data); ^ TypeError: requestChannel.pendingRequest.handleBody is not a function