File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -279,10 +279,9 @@ def _load_method_and_content_type(self):
279279 if not _hasattr (self , '_method' ):
280280 self ._method = self ._request .method
281281
282- if self ._method == 'POST' :
283- # Allow X-HTTP-METHOD-OVERRIDE header
284- self ._method = self .META .get ('HTTP_X_HTTP_METHOD_OVERRIDE' ,
285- self ._method )
282+ # Allow X-HTTP-METHOD-OVERRIDE header
283+ self ._method = self .META .get ('HTTP_X_HTTP_METHOD_OVERRIDE' ,
284+ self ._method )
286285
287286 def _load_stream (self ):
288287 """
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ def test_x_http_method_override_header(self):
6666 request = Request (factory .post ('/' , {'foo' : 'bar' }, HTTP_X_HTTP_METHOD_OVERRIDE = 'DELETE' ))
6767 self .assertEqual (request .method , 'DELETE' )
6868
69+ request = Request (factory .get ('/' , {'foo' : 'bar' }, HTTP_X_HTTP_METHOD_OVERRIDE = 'DELETE' ))
70+ self .assertEqual (request .method , 'DELETE' )
71+
6972
7073class TestContentParsing (TestCase ):
7174 def test_standard_behaviour_determines_no_content_GET (self ):
You can’t perform that action at this time.
0 commit comments