Set 'Transfer-Encoding: chunked' if data is a file with length 0#2896
Set 'Transfer-Encoding: chunked' if data is a file with length 0#2896sigmavirus24 merged 2 commits intopsf:masterfrom
Conversation
|
@BraulioVM This is a good first pass! I have a draft of this fix sitting around on my laptop, so when I get home I'll show you how I approached it and let you take the ideas you like best. |
|
So I think this change is not quite right. What we want is a simple change around line 437. Right now we test |
|
I see. What I did didn't make any sense because file objects are streams. However, this change won't just affect files, it will affect any stream with length 0. Things will keep working, but I thought we just wanted to set 'Transfer-Encoding: chunked' if |
|
@BraulioVM That's actually intentional: sending a chunked zero-length stream is fine, there won't be a problem there. That way, the code is clearer. =) So, this change looks good to me, but I'll let @sigmavirus24 review it. |
|
Is there anything else I should do regarding this PR? |
|
@BraulioVM Nope, just waiting for @sigmavirus24 to get enough time to swing by and take a look at it. =) |
|
Woops! Sorry. I lost track of this with recent goings on IRL. This looks great to me! Thanks @BraulioVM |
[WIP] Set 'Transfer-Encoding: chunked' if data is a file with length 0
Fixes #2215
This is the first time I contribute to the project so I am not sure at all I put that code where it belongs. I know I have to add tests for this, but wanted to show you this beforehand.
Did I do this right?
Thank you