forked from orbit-oss/flask
Fix blueprint nested url_prefix
This ensures that the url_prefix is correctly applied, no matter if set during the registration override or when constructing the blueprint.
This commit is contained in:
parent
a541c2ac8b
commit
99afbb277d
2 changed files with 28 additions and 42 deletions
|
|
@ -354,7 +354,9 @@ class Blueprint(Scaffold):
|
|||
bp_options["url_prefix"] = (
|
||||
state.url_prefix.rstrip("/") + "/" + bp_url_prefix.lstrip("/")
|
||||
)
|
||||
else:
|
||||
elif bp_url_prefix is not None:
|
||||
bp_options["url_prefix"] = bp_url_prefix
|
||||
elif state.url_prefix is not None:
|
||||
bp_options["url_prefix"] = state.url_prefix
|
||||
|
||||
bp_options["name_prefix"] = options.get("name_prefix", "") + self.name + "."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue