getting host without parsing url
This commit is contained in:
parent
c5e2d749e9
commit
1160a0e1ba
|
@ -6,7 +6,7 @@
|
|||
{
|
||||
"label": "build",
|
||||
"type": "shell",
|
||||
"command": "NODE_OPTIONS=--openssl-legacy-provider wrangler build",
|
||||
"command": "wrangler build",
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
|
@ -16,7 +16,7 @@
|
|||
{
|
||||
"label": "dev",
|
||||
"type": "shell",
|
||||
"command": "NODE_OPTIONS=--openssl-legacy-provider wrangler dev",
|
||||
"command": "wrangler dev",
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "test",
|
||||
|
@ -26,7 +26,7 @@
|
|||
{
|
||||
"label": "publish",
|
||||
"type": "shell",
|
||||
"command": "NODE_OPTIONS=--openssl-legacy-provider wrangler publish"
|
||||
"command": "wrangler publish"
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
3
index.js
3
index.js
|
@ -69,7 +69,6 @@ let sid
|
|||
let access_token
|
||||
router.get('/:type/:id', async request => {
|
||||
const { query } = request
|
||||
const url = new URL(request.url)
|
||||
let { type, id } = request.params
|
||||
|
||||
if (!['track', 'album', 'playlist'].includes(type)) {
|
||||
|
@ -142,7 +141,7 @@ router.get('/:type/:id', async request => {
|
|||
return await track(id, format, tagging)
|
||||
case 'album':
|
||||
case 'playlist':
|
||||
return await m3u8(type, id, format, tagging, url.host)
|
||||
return await m3u8(type, id, format, tagging, request.headers.get('host'))
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -7,4 +7,4 @@ kv_namespaces = [
|
|||
{ binding = "KV", id = "974c0967a84e415daa054bbbcc7f80c6", preview_id = "cfcc6491f3484cbca664913836635113" }
|
||||
]
|
||||
vars = { ARL = "amogus" }
|
||||
compatibility_date = "2021-11-21"
|
||||
compatibility_date = "2021-12-03"
|
Loading…
Reference in New Issue