add websocket secure scheme in request @messense
This commit is contained in:
parent
3af26540ec
commit
250bb7e29d
|
@ -144,12 +144,14 @@ class Request(dict):
|
|||
def scheme(self):
|
||||
if self.app.websocket_enabled \
|
||||
and self.headers.get('upgrade') == 'websocket':
|
||||
return 'ws'
|
||||
scheme = 'ws'
|
||||
else:
|
||||
scheme = 'http'
|
||||
|
||||
if self.transport.get_extra_info('sslcontext'):
|
||||
return 'https'
|
||||
scheme += 's'
|
||||
|
||||
return 'http'
|
||||
return scheme
|
||||
|
||||
@property
|
||||
def host(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user