ruff: enable upgrade rule checks
This commit is contained in:
@@ -13,7 +13,7 @@ router = APIRouter()
|
||||
async def root(path_name: str) -> Response:
|
||||
if path_name == "":
|
||||
path_name = "index.html"
|
||||
filename = Path(os.path.normpath((asset_path() / path_name)))
|
||||
filename = Path(os.path.normpath(asset_path() / path_name))
|
||||
|
||||
if not filename.is_relative_to(asset_path()):
|
||||
# prevent directory traversal
|
||||
|
||||
@@ -20,7 +20,7 @@ def try_bind_port(port: int) -> bool:
|
||||
tcp.bind(("127.0.0.1", port))
|
||||
udp.bind(("127.0.0.1", port))
|
||||
return True
|
||||
except socket.error:
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user