Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is a call being made to an external site at all? #337

Open
mjlachman opened this issue Feb 15, 2024 · 2 comments
Open

Why is a call being made to an external site at all? #337

mjlachman opened this issue Feb 15, 2024 · 2 comments

Comments

@mjlachman
Copy link

When using this library, it calls out to https://jimmywarting.github.io/StreamSaver.js/mitm.html to stream downloads. If I have the library included in my bundle, it should not be calling to any external site whatsoever to process a download. This is a huge security risk.

@wcroachie
Copy link

The only way to stream a download in all browsers requires that the Content-Disposition header in the response be set to Attachment, currently the only way of doing this is either configuring the server that way, or if you're going serverless, to run a service worker on a site served via https that intercepts the request and edits the headers. This is what streamsaver does, more or less, via an iframe.
If you want you can just download a copy of the mitm file and then host it wherever (i.e like a github.io site) so that you have control over it. This is what I do. You just have to set Streamsaver.mitm to my-site/mitm.html.

@Sachinthafdo
Copy link

const streamSaver = {
createWriteStream,
WritableStream: global.WritableStream || ponyfill.WritableStream,
supported: true,
version: { full: '2.0.5', major: 2, minor: 0, dot: 5 },
mitm: '../mitm.html?version=2.0.0'
}

update streamsaver.js like this

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

No branches or pull requests

3 participants