Re: [Django] #30227: POST "multipart/form-data" without "boundary" causes AttributeError

2019-03-02 Thread Django
#30227: POST "multipart/form-data" without "boundary" causes AttributeError
-+-
 Reporter:  Oxygen   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  HTTP handling|  Version:  2.1
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  multipart, boundary  | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"2ed2acf872b87d1149da98ceeb96997f23258e83" 2ed2acf8]:
 {{{
 #!CommitTicketReference repository=""
 revision="2ed2acf872b87d1149da98ceeb96997f23258e83"
 Fixed #30227 -- Fixed crash on request without boundary in Content-Type.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.c924e713372b11999833a691351d878c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30227: POST "multipart/form-data" without "boundary" causes AttributeError

2019-03-02 Thread Django
#30227: POST "multipart/form-data" without "boundary" causes AttributeError
-+-
 Reporter:  Oxygen   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  HTTP handling|  Version:  2.1
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  multipart, boundary  | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"8ec7ded3706fe66bf307ed339eb852d73f6d10d0" 8ec7ded3]:
 {{{
 #!CommitTicketReference repository=""
 revision="8ec7ded3706fe66bf307ed339eb852d73f6d10d0"
 Refs #30227 -- Added helpful message for non-ASCII Content-Type in
 mulitpart request.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.26703568b116592864b7d9595425deb1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30227: POST "multipart/form-data" without "boundary" causes AttributeError

2019-03-02 Thread Django
#30227: POST "multipart/form-data" without "boundary" causes AttributeError
-+-
 Reporter:  Oxygen   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  2.1
 Severity:  Normal   |   Resolution:
 Keywords:  multipart, boundary  | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.3de3920395909b5aa50eca5f44945b0a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30227: POST "multipart/form-data" without "boundary" causes AttributeError

2019-03-01 Thread Django
#30227: POST "multipart/form-data" without "boundary" causes AttributeError
-+
 Reporter:  Oxygen   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  2.1
 Severity:  Normal   |   Resolution:
 Keywords:  multipart, boundary  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by Tim Graham):

 Yes, it crashes at `content_type.encode('ascii')`. I added a second commit
 with a helpful message for that case.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.dd6e740e25c2565a3d0f62d3813d32f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30227: POST "multipart/form-data" without "boundary" causes AttributeError

2019-03-01 Thread Django
#30227: POST "multipart/form-data" without "boundary" causes AttributeError
-+
 Reporter:  Oxygen   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  2.1
 Severity:  Normal   |   Resolution:
 Keywords:  multipart, boundary  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by Simon Charette):

 Tim, I think that passing an invalid UTF-8 byte sequence as boundary could
 cause `force_str` to crash with `UnicodeDecodeError`

 e.g. `boundary = u'timgràhàm'.encode('latin').decode('utf-8')`

 But that might crash even sooner.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.a0329171bb585f68cb8eecc3e5266bdc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30227: POST "multipart/form-data" without "boundary" causes AttributeError

2019-03-01 Thread Django
#30227: POST "multipart/form-data" without "boundary" causes AttributeError
-+
 Reporter:  Oxygen   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  2.1
 Severity:  Normal   |   Resolution:
 Keywords:  multipart, boundary  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Tim Graham):

 * has_patch:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 [https://github.com/django/django/pull/11042 PR]

 I didn't include `errors="replace"` -- can you give a case where that's
 needed?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.7e4632efc261b488915bd09970c79d57%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30227: POST "multipart/form-data" without "boundary" causes AttributeError

2019-02-28 Thread Django
#30227: POST "multipart/form-data" without "boundary" causes AttributeError
-+-
   Reporter: |  Owner:  nobody
  chenzhuoyu |
   Type:  Bug| Status:  new
  Component:  HTTP   |Version:  2.1
  handling   |
   Severity:  Normal |   Keywords:  multipart, boundary
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 `curl -sv http://example.com/my_api/ -XPOST -H 'Content-Type: multipart
 /form-data'`

 This causes an "500 Internal Server Error", which is supposed to be "400
 Bad Request".

 Traceback with sensitive information removed:

 {{{
 Traceback (most recent call last):
   ...
   File ".../site-packages/django/core/handlers/wsgi.py", line 111, in
 _get_post
 self._load_post_and_files()
   File ".../site-packages/django/http/request.py", line 310, in
 _load_post_and_files
 self._post, self._files = self.parse_file_upload(self.META, data)
   File ".../site-packages/django/http/request.py", line 268, in
 parse_file_upload
 parser = MultiPartParser(META, post_data, self.upload_handlers,
 self.encoding)
   File ".../site-packages/django/http/multipartparser.py", line 72, in
 __init__
 raise MultiPartParserError('Invalid boundary in multipart: %s' %
 boundary.decode())
 AttributeError: 'NoneType' object has no attribute 'decode'
 }}}

 Possible fix:

 Replace `boundary.decode()` at `django/http/multipartparser.py:72` with
 `force_text(boundary, errors="replace")`

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.cf3b2c87b52a8bca2990922ea810bdf9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.