Fix TypeError when use Blueprint.group() to group blueprint with default url_prefix, Use os.path.normpath to avoid invalid url_prefix like api//v1
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from collections import defaultdict, namedtuple
|
||||
|
||||
from sanic.constants import HTTP_METHODS
|
||||
@@ -54,7 +55,10 @@ class Blueprint:
|
||||
yield i
|
||||
bps = []
|
||||
for bp in chain(blueprints):
|
||||
if bp.url_prefix is None:
|
||||
bp.url_prefix = ''
|
||||
bp.url_prefix = url_prefix + bp.url_prefix
|
||||
bp.url_prefix = os.path.normpath(bp.url_prefix)
|
||||
bps.append(bp)
|
||||
return bps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user