These are chat archives for deployd/contributors

25th
Feb 2015
Eric Fong
@ericfong
Feb 25 2015 04:37
I am using withCredentials=true . For PR 521, shall we do that in core or dpd-module? (It seems hard to move out to dpd module). AUTHORIZATION header may also filtered by browser by the way.
Madd.is
@EyMaddis
Feb 25 2015 17:15
Hi everyone. I am working on a PR for deployd/deployd#519 But there is a minor problem which I would love to have your input for
I am working on the compatibility using a req.rawBody, I would like to add detection if the stream is already closed, but that is not possible without using private members of the request, basically
if(req._readableState.ended) {
    console.error('deployd cannot read the request, because another middleware already read the stream.');
    console.error('change the middleware or write the request data to request.rawBody');
    throw new Error('unable to read request data from drained stream');
  }
Madd.is
@EyMaddis
Feb 25 2015 17:21
first of all, would you recommend using this or leave it out and second I would need to change every parseBody test to add the _readableState.ended, which is kind of ugly
Third possibility: I could just ignore it, if readableState does not exist
@Maddis1337 the latter problem seems to be occuring because in tests there is no actual ReadableStream instance, but rather a Stream instance supplied to the parseBody method. If so, you might be able to just change the way that Stream is created and use a ReadableStream instead, so that you can just use the _readableState - wouldn't that work? Of course it's still up for discussion if using the private api is a good idea at all