Accept a custom reason phrase for the HTTP response (Fixes #25)
This commit is contained in:
@@ -74,9 +74,10 @@ class Response(BaseResponse):
|
||||
self.complete()
|
||||
|
||||
# status code
|
||||
reason = self.reason if self.reason is not None else \
|
||||
('OK' if self.status_code == 200 else 'N/A')
|
||||
await stream.awrite('HTTP/1.0 {status_code} {reason}\r\n'.format(
|
||||
status_code=self.status_code,
|
||||
reason='OK' if self.status_code == 200 else 'N/A').encode())
|
||||
status_code=self.status_code, reason=reason).encode())
|
||||
|
||||
# headers
|
||||
for header, value in self.headers.items():
|
||||
|
||||
Reference in New Issue
Block a user