mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 05:41:20 -08:00
test(asr): [PKG-ASR-05] cover CORS and independent audio combinations
This commit is contained in:
1 parent
2cede66933
commit
5ab7da6e1f
12 files changed
+6360
-4
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user