Skip to content

Commit b96e084

Browse files
committed
fix: 修复漏洞
1 parent e2d5182 commit b96e084

4 files changed

Lines changed: 11 additions & 13 deletions

File tree

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/dashboard/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Python OpenBMCLAPI Dashboard</title>
7-
<script type="module" crossorigin src="/assets/index-DsyND4Ca.js"></script>
7+
<script type="module" crossorigin src="/assets/index-BQ9kYwai.js"></script>
88
<link rel="stylesheet" crossorigin href="/assets/index-BhTleVqd.css">
99
</head>
1010
<body>

core/storages/alist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async def getMissingFiles(self, files: FileList, pbar: tqdm) -> FileList:
9090
existing_files: List[FileInfo] = []
9191
async with aiohttp.ClientSession(self.url, headers=self.headers) as session:
9292

93-
async def getFileList(dir: str) -> List[FileInfo]:
93+
async def getFileList(dir: str, pbar: tqdm) -> List[FileInfo]:
9494
file_path = self.path + dir
9595
response = await session.post(
9696
"/api/fs/list", headers=self.headers, json={"path": file_path}
@@ -113,7 +113,7 @@ async def getFileList(dir: str) -> List[FileInfo]:
113113
) as _pbar:
114114
for i in range(256):
115115
dir = f"/{i:02x}"
116-
existing_files += await getFileList(dir)
116+
existing_files += await getFileList(dir, _pbar)
117117

118118
existing_info: Set[Tuple[str, int]] = {
119119
(file.hash, file.size) for file in existing_files

dashboard/src/api/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@ export async function fetchRank() {
5151
}
5252

5353
function getWebSocketURL(path: string) {
54-
const baseURL = axios.defaults.baseURL || ''
55-
const url = new URL(baseURL)
56-
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:'
57-
url.pathname = path
58-
return url.toString()
54+
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
55+
const host = window.location.host
56+
return `${protocol}//${host}${path}`
5957
}
6058

6159
const ws = new WebSocket(getWebSocketURL('/ws/logs'))

0 commit comments

Comments
 (0)