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

Commit 44be1fe

Browse files
committed
✨跟随node端在header添加x-bmclapi-hash/去除dev版
1 parent c8cd06e commit 44be1fe

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ $config=[
7979
```
8080

8181
## 📍 Todo
82-
- [ ] 可以正常上线使用(主要)
82+
- [x] 可以正常上线使用(主要)
8383
- [ ] 添加注释
8484
- [ ] Web界面
8585
- [ ] 统一的管理API

inc/server.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public function startserver() {
6666
}
6767
$code = 206;
6868
$response->header('Content-Type', 'application/octet-stream');
69-
$response->header('Content-Type', 'application/octet-stream');
69+
$response->header('Content-Disposition', $allurl['name']);
70+
$response->header('x-bmclapi-hash', $downloadhash);
7071
$response->sendfile($filepath,$start_byte,$length);
7172
}
7273
else{
@@ -78,7 +79,8 @@ public function startserver() {
7879
}
7980
$code = 200;
8081
$response->header('Content-Type', 'application/octet-stream');
81-
$response->header('Content-Type', 'application/octet-stream');
82+
$response->header('Content-Disposition', $allurl['name']);
83+
$response->header('x-bmclapi-hash', $downloadhash);
8284
$response->sendfile($filepath);
8385
}
8486
}

main.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use function Swoole\Timer;
55
declare(ticks=1)
66
require './config.php';
7-
const PHPOBAVERSION = '0.0.1';
7+
const PHPOBAVERSION = '1.0.0';
88
const VERSION = '1.10.4';
99
global $DOWNLOAD_DIR;
1010
$DOWNLOAD_DIR = $config['file']['cache_dir'];
@@ -19,7 +19,7 @@
1919
$pid = getmypid();
2020
global $enable;
2121
$enable = false;
22-
echo"OpenBmclApionPHP v". PHPOBAVERSION . "-" . VERSION . "-dev" . PHP_EOL;
22+
echo"OpenBmclApionPHP v". PHPOBAVERSION . "-" . VERSION . PHP_EOL;
2323
run(function()use ($config){
2424
//注册信号处理器
2525
function registerSigintHandler() {

0 commit comments

Comments
 (0)