Browse Source

Move logic to else block to avoid unnecessary modifications

pull/11160/head
Ricardo Madriz 1 year ago
parent
commit
e2599bda9a
  1. 1
      fastapi/applications.py

1
fastapi/applications.py

@ -1057,6 +1057,7 @@ class FastAPI(Starlette):
f"configured in FastAPI. The configured root path is: " f"configured in FastAPI. The configured root path is: "
f"{self.root_path}, the ASGI server root path is: {root_path}. " f"{self.root_path}, the ASGI server root path is: {root_path}. "
) )
else:
scope["root_path"] = self.root_path scope["root_path"] = self.root_path
path = scope.get("path") path = scope.get("path")
if path and not path.startswith(self.root_path): if path and not path.startswith(self.root_path):

Loading…
Cancel
Save