bigchaindb / bigchaindb-driver

Official Python driver for BigchainDB
https://www.bigchaindb.com
Apache License 2.0
105 stars 104 forks source link

[handcraft tx] Document the need to pass a Content-Length header in the request #266

Closed sbellem closed 6 years ago

sbellem commented 7 years ago

from @mgrand on gitter:

It turns out that what flask was objecting to about my post is Transfer-Encoding: chunked So something to add to the handcrafting instructions is to avoid that and to provide a Content-Length header.

sohkai commented 7 years ago

Looks like WSGI just doesn't support chunked encoding at all: https://github.com/pallets/flask/issues/367#issuecomment-33439398. @ttmc this is something we should probably note in the HTTP docs (maybe there's a list of common gotchas / unsupported features in WSGI).

I'm not sure how explicit we have to be about requiring a Content-Length header; I think implementations almost always provide this automatically if it's a HTTP request with a body (barring no weird things like Transfer-Encoding: chunked that omit the Content-Length header)?

TimDaub commented 7 years ago

Bit off-topic here, I'll do it anyways:

Looks like WSGI just doesn't support chunked encoding at all: pallets/flask#367 (comment). @ttmc this is something we should probably note in the HTTP docs (maybe there's a list of common gotchas / unsupported features in WSGI).

I actually think we should even disable this behavior in flask if necessary. BigchainDB's external interfaces should follow Postel's law (aka. Principle of Robustness):

Be conservative in what you do, be liberal in what you accept from others.

mgrand commented 7 years ago

Please do note the need for content-length in the instructions. Most Java libraries to not automatically generate content-length.

On Thu, Feb 9, 2017 at 10:00 AM, Tim Daubenschütz notifications@github.com wrote:

Bit off-topic here, I'll do it anyways:

Looks like WSGI just doesn't support chunked encoding at all: pallets/flask#367 https://github.com/pallets/flask/issues/367 (comment). @ttmc https://github.com/ttmc this is something we should probably note in the HTTP docs (maybe there's a list of common gotchas / unsupported features in WSGI).

I actually think we should even disable this in flask if necessary. BigchainDB's external interfaces should follow Postel's law https://en.wikipedia.org/wiki/Robustness_principle (aka. Principle of Robustness):

Be conservative in what you do, be liberal in what you accept from others.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bigchaindb/bigchaindb-driver/issues/266#issuecomment-278597264, or mute the thread https://github.com/notifications/unsubscribe-auth/AAlDFtMDfon-KH4r9cXkt3f5Zs2IUQ54ks5rauOvgaJpZM4L7dj3 .

-- Mark Grand (404)925 8265 Vision, Values, Verve:

krish7919 commented 7 years ago

I would let the Content-Length be in there for metering, just in case.