Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

adding cors for ?proxied content #48

Open
rosolinol opened this issue Aug 5, 2020 · 0 comments
Open

adding cors for ?proxied content #48

rosolinol opened this issue Aug 5, 2020 · 0 comments

Comments

@rosolinol
Copy link

Hello,

any idea how to enable "Access-Control-Allow-Origin": '*', for ?proxied content ?! i've add "Access-Control-Allow-Origin": '*', almost everywhere but still when i try to access content from url?proxied it still cannot access it from another website

async function proxiedDownload(downloadUrl) {
    console.info(`ProxyDownload -> ${downloadUrl}`);
    const remoteResp = await fetch(downloadUrl);
    let option = {
        status: 200, 
        headers: {
        "Access-Control-Allow-Origin": '*',
        }
    };
    let {
        readable,
        writable
    } = new TransformStream();
    remoteResp.body.pipeTo(writable);
    return new Response(readable, remoteResp, option);
}

is not working... help?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant