mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-16 10:18:28 +00:00
Fix local development download issues
Fixes issues downloading files retrieved from a local instance of cobalt. The fix involves changing the URL that createStream() in modules/stream/manage.js returns to just a slug, and having the frontend find the origin to prepend to the slug for its API call.
This commit is contained in:
parent
b4eddd06fe
commit
b62627058e
@ -366,7 +366,8 @@ async function download(url) {
|
||||
break;
|
||||
case "stream":
|
||||
changeDownloadButton(2, '?..')
|
||||
fetch(`${j.url}&p=1`).then(async (res) => {
|
||||
const streamUrl = location.origin + j.url;
|
||||
fetch(`${streamUrl}&p=1`).then(async (res) => {
|
||||
let jp = await res.json();
|
||||
if (jp.status === "continue") {
|
||||
changeDownloadButton(2, '>>>'); window.location.href = j.url;
|
||||
|
@ -38,7 +38,7 @@ export function createStream(obj) {
|
||||
exp = streamInfo.exp;
|
||||
ghmac = streamInfo.hmac;
|
||||
}
|
||||
return `${process.env.selfURL}api/stream?t=${streamID}&e=${exp}&h=${ghmac}`;
|
||||
return `/api/stream?t=${streamID}&e=${exp}&h=${ghmac}`;
|
||||
}
|
||||
|
||||
export function verifyStream(ip, id, hmac, exp) {
|
||||
|
Loading…
Reference in New Issue
Block a user