Merge pull request #951 from lixxu/master
fix bug and set scheme to http if not provided
This commit is contained in:
commit
00d40a35cd
|
@ -460,7 +460,10 @@ class Sanic:
|
||||||
|
|
||||||
if external:
|
if external:
|
||||||
if not scheme:
|
if not scheme:
|
||||||
scheme = netloc[:8].split(':', 1)[0]
|
if ':' in netloc[:8]:
|
||||||
|
scheme = netloc[:8].split(':', 1)[0]
|
||||||
|
else:
|
||||||
|
scheme = 'http'
|
||||||
|
|
||||||
if '://' in netloc[:8]:
|
if '://' in netloc[:8]:
|
||||||
netloc = netloc.split('://', 1)[-1]
|
netloc = netloc.split('://', 1)[-1]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user