I'm using CouchDB through Nginx proxy pass and SSL. Using the method execute from Doctrine\CouchDB\View\Query, I receive Doctrine\CouchDB\HTTP\Response with a NULL body, because json_decode can't decode the body response content in Response constructor.
Checking the SocketClient and the do...while loop from request method, the second parameter to fread is $bytesLeft + 2 and that is appending a line break (vim ^M) at the end of the line content read from server. Besides that, after loop, there's a substr "choping off" 2 bytes from the end of the body content, removing the end json content. Chunk capture is breaking the json syntax and json_decode don't work correctly.
Hi,
I'm using CouchDB through Nginx proxy pass and SSL. Using the method
execute
fromDoctrine\CouchDB\View\Query
, I receiveDoctrine\CouchDB\HTTP\Response
with aNULL
body, becausejson_decode
can't decode the body response content inResponse
constructor.Checking the
SocketClient
and thedo...while
loop fromrequest
method, the second parameter tofread
is$bytesLeft + 2
and that is appending a line break (vim^M
) at the end of the line content read from server. Besides that, after loop, there's asubstr
"choping off" 2 bytes from the end of the body content, removing the endjson
content. Chunk capture is breaking thejson
syntax andjson_decode
don't work correctly.Why?
https://github.com/doctrine/couchdb-client/blob/c80f25002d83712209517793d3f5402edaefe68a/lib/Doctrine/CouchDB/HTTP/SocketClient.php#L276-L295
My Nginx
proxy_buffering
isoff
and myproxy_buffer
have a value of4k
.I just execute a
curl
from console with the same path fromSocketClient
and the response is a validjson
syntax.