[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-02 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Patched the behaviors when NO_CONTENT and RESET_CONTENT are sent via 
send_error(). According to RFCs, they aren't actually errors so sending them 
through send_response() seems to make the most sense, however.

send_error()'s behavior changes in this patch are:
 - Removed content-length field in the header for NO_CONTENT as per the RFC
 - Removed content-length field in the header for RESET_CONTENT also to comply 
with option c) mentioned in RFC7321 6.3.6

--
keywords: +patch
nosy: +Susumu Koshiba
versions: +Python 3.6
Added file: http://bugs.python.org/file43129/issue25738_http_reset_content.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-03 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Thanks,

I've added some comments to the doc and updated the patch.

--
Added file: 
http://bugs.python.org/file43182/issue25738_http_reset_content_02.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-04 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Thanks a lot for a quick review. I've created a new patch with below changes.
 1. No content-length and the body to be sent for:
 a. 204(No Content)
 b. 205(Reset Content)
 c. 304(Not Modified)
 d. response to HEAD request method
 e. 1xx
 2. Documentation change to remove version changed, in case we are making this 
patch to 2.7 and 3.5

I've added test cases for most of the scenarios mentioned above, but the 
behavior of 100(Continue) is left out due to the fact that sending 
100(Continue) via send_error() gets tricky as it's not meant to close the 
connection after sending this response. I'm a bit undecided about the handling 
of 100(Continue) code in send_error() so I'll leave it as-is for now and 
possibly file a separate ticket depending on what we decide to do.

Happy to patch 2.7, 3.5 as a bug fix also.

--
Added file: 
http://bugs.python.org/file43203/issue25738_http_reset_content_03.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-04 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Sorry, re-created a patch to do the right word wrapping and made my comments 
less verbose.

--
Added file: 
http://bugs.python.org/file43204/issue25738_http_reset_content_04.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-04 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Thanks again for valuable comments.

I agree that there could be a case where send_error() gets used for both HEAD 
and GET, in which case we could send content-length field as an optional field. 
However, if send_error() is not used for both HEAD and GET, then the body will 
likely be different and RFC specifies that we must not send content-length 
field with different values so I have a slight preference towards not sending 
it for HEAD request. 

If you are OK with leaving content-length out for HEAD, I'd like to proceed 
with creating a small patch to reflect your comments in code review and also 
start creating a patches for 2.7 and 3.5.

--

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-04 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Thanks, makes sense to me.

I've created patches for 2.7, 3.5, 3.6. 3.5's implementation looked slightly 
different from 3.6 so I've decided to create a separate patch, just in case. I 
will upload them 1 by 1 starting with 2.7. It will get a bit noisy here(sorry).

--
Added file: 
http://bugs.python.org/file43223/issue25738_http_reset_content_2.7_01.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-04 Thread Susumu Koshiba

Susumu Koshiba added the comment:

3.5 patch.

--
Added file: 
http://bugs.python.org/file43224/issue25738_http_reset_content_3.5_01.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-04 Thread Susumu Koshiba

Susumu Koshiba added the comment:

3.6 patch(..._05.patch file)

--
Added file: 
http://bugs.python.org/file43225/issue25738_http_reset_content_05.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-05 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Ah yes, you are right. I didn't think about the cases where it will send HEAD 
for codes like 204(No Content). I've created a patch for 3.6 to see if this 
looks reasonable, if review passes, I'll create patches for the rest of the 
releases.

Thanks a lot for pointing this out.

--
Added file: 
http://bugs.python.org/file43255/issue25738_http_reset_content_06.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-07 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Thanks for the suggestions, I've updated the test cases and created a patch for 
3.6.

--
Added file: 
http://bugs.python.org/file43277/issue25738_http_reset_content_07.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-07 Thread Susumu Koshiba

Susumu Koshiba added the comment:

Great, thanks for checking. Attaching patch for 2.7. 3.5 will follow.

--
Added file: 
http://bugs.python.org/file43291/issue25738_http_reset_content_2.7_02.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-07 Thread Susumu Koshiba

Susumu Koshiba added the comment:

A patch for 3.5 attached.

--
Added file: 
http://bugs.python.org/file43292/issue25738_http_reset_content_3.5_02.patch

___
Python tracker 
<http://bugs.python.org/issue25738>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com