dsh-folia 4.26.0-pre.59 → 4.26.0-pre.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/routes/pet-chat.js +2 -1
- package/package.json +1 -1
package/lib/routes/pet-chat.js
CHANGED
|
@@ -1939,7 +1939,8 @@ async function handleMicTest(req, res) {
|
|
|
1939
1939
|
res.setHeader('Content-Type', 'audio/wav');
|
|
1940
1940
|
res.setHeader('Content-Length', String(bytes.length));
|
|
1941
1941
|
res.setHeader('Cache-Control', 'no-store');
|
|
1942
|
-
|
|
1942
|
+
// 中文设备名不能直接进 HTTP 头(Node 会报 Invalid character in header)⇒ URL 编码
|
|
1943
|
+
res.setHeader('X-Folia-Mic-Device', encodeURIComponent(String(result.device || '')));
|
|
1943
1944
|
res.setHeader('X-Folia-Mic-Rms', String(result.audioRms == null ? '' : result.audioRms));
|
|
1944
1945
|
res.setHeader('X-Folia-Mic-Db', String(result.audioDb == null ? '' : result.audioDb));
|
|
1945
1946
|
res.setHeader('X-Folia-Mic-Bytes', String(result.bytes || bytes.length));
|