Merge pull request #951 from lixxu/master

fix bug and set scheme to http if not provided
This commit is contained in:
Raphael Deem 2017-09-26 21:57:54 -07:00 committed by GitHub
commit 00d40a35cd

View File

@ -460,7 +460,10 @@ class Sanic:
if external:
if not scheme:
if ':' in netloc[:8]:
scheme = netloc[:8].split(':', 1)[0]
else:
scheme = 'http'
if '://' in netloc[:8]:
netloc = netloc.split('://', 1)[-1]