Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 4614bd9

Browse files
committed
🐛 返回文件名称报错
1 parent b8ce237 commit 4614bd9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

inc/server.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public function startserver() {
6666
}
6767
$code = 206;
6868
$response->header('Content-Type', 'application/octet-stream');
69-
$response->header('Content-Disposition', $allurl['name']);
69+
if(isset($request->header['name'])){
70+
$response->header('Content-Disposition', $allurl['name']);
71+
}
7072
$response->header('x-bmclapi-hash', $downloadhash);
7173
$result = $response->sendfile($filepath,$start_byte,$length);
7274
}
@@ -79,7 +81,9 @@ public function startserver() {
7981
}
8082
$code = 200;
8183
$response->header('Content-Type', 'application/octet-stream');
82-
$response->header('Content-Disposition', $allurl['name']);
84+
if(isset($request->header['name'])){
85+
$response->header('Content-Disposition', $allurl['name']);
86+
}
8387
$response->header('x-bmclapi-hash', $downloadhash);
8488
$result = $response->sendfile($filepath);
8589
}

0 commit comments

Comments
 (0)