test(asr): [PKG-ASR-05] cover CORS and independent audio combinations

This commit is contained in:
Harvey Zhao committed 2026-09-13 16:07:01 +08:00
1 parent 2cede66933
commit 5ab7da6e1f
12 files changed
+6360 -4

No files matched your search

+9
View File
@@ -116,6 +116,15 @@ const server = http.createServer((req, res) => {
assert(['GET', 'HEAD'].includes(req.method), 'Unsupported method')
const url = new URL(req.url, `http://127.0.0.1:${port}`)
const caseId = url.searchParams.get('case')
if (url.pathname === '/test/asr-cors.m4a') {
res.setHeader('Access-Control-Allow-Origin', '*')
send(req, res, files.get('/test/audio-tone.m4a'), url.pathname)
return
}
if (url.pathname === '/test/asr-opaque-redirect') {
res.writeHead(302, { Location: `http://localhost:${port}/test/audio-tone.m4a` }).end()
return
}
if (url.pathname === '/test/iframe-boundary-redirect') {
res.writeHead(302, { Location: `http://localhost:${port}/test/iframe-boundary-child.html${url.search}` }).end()
return