Kaydet (Commit) 7dc4f4bb authored tarafından Jason R. Coombs's avatar Jason R. Coombs

Issue #18978: Allow Request.method to be defined at the class level.

üst 4f7a36f8
...@@ -271,6 +271,7 @@ class Request: ...@@ -271,6 +271,7 @@ class Request:
origin_req_host = request_host(self) origin_req_host = request_host(self)
self.origin_req_host = origin_req_host self.origin_req_host = origin_req_host
self.unverifiable = unverifiable self.unverifiable = unverifiable
if method:
self.method = method self.method = method
@property @property
...@@ -320,7 +321,7 @@ class Request: ...@@ -320,7 +321,7 @@ class Request:
def get_method(self): def get_method(self):
"""Return a string indicating the HTTP request method.""" """Return a string indicating the HTTP request method."""
if self.method is not None: if getattr(self, 'method', None) is not None:
return self.method return self.method
elif self.data is not None: elif self.data is not None:
return "POST" return "POST"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment