#17474: Problem when the request doesn't have Content-Type. -------------------------------------+------------------------------------- Reporter: Marcelo Salhab | Owner: nobody Brogliato <msbrogli@…> | Status: reopened Type: Bug | Version: 1.4 Component: HTTP handling | Resolution: Severity: Normal | Triage Stage: Design Keywords: content-type | decision needed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Ashwin Purohit <purohit@…>):
* cc: purohit@… (added) * version: 1.3 => 1.4 Comment: This same thing happens in 1.4: {{{ File "/usr/local/lib/Django1.4/django/core/handlers/modpython.py", line 56, in _get_request self._request = datastructures.MergeDict(self.POST, self.GET) File "/usr/local/lib/Django1.4/django/core/handlers/modpython.py", line 69, in _get_post self._load_post_and_files() File "/usr/local/lib/Django1.4/django/http/_init_.py", line 353, in _load_post_and_files if self.META.get('CONTENT_TYPE', '').startswith('multipart'): AttributeError: 'NoneType' object has no attribute 'startswith' Request repr() unavailable. }}} You can easily test it by writing a test that sends a POST without the CONTENT_TYPE header: {{{ def test_missing_content_type(self): // Will throw an exception: response = self.client.post('/url/', {}, HTTP_CONTENT_TYPE=None, follow=True) }}} -- Ticket URL: <https://code.djangoproject.com/ticket/17474#comment:10> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.