StreamSaver.js icon indicating copy to clipboard operation
StreamSaver.js copied to clipboard

Do I need to use mitm?

Open ZainChenDev opened this issue 1 year ago • 1 comments

I've recently been trying to use Streamsaver.js to transfer file streams from my own server to the frontend browser. I've successfully set the Content-Disposition and Content-Type, where Content-Type is determined to be application/octet-stream. this is my code on my (springboot) server:

public void getMinioObject(String bucket, String objectKey, HttpServletResponse response)  {
    StatObjectResponse stat = minioClient.statObject(
        StatObjectArgs.builder()
            .bucket(bucket)
            .object(objectKey)
            .build()
    );
    response.setContentType(stat.contentType());
    response.setCharacterEncoding("UTF-8");
    response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(objectKey, "UTF-8"));

    InputStream is = minioClient.getObject(GetObjectArgs.builder().bucket(bucket).object(objectKey).build());
    IOUtils.copy(is, response.getOutputStream());
    is.close();
}

I would like to know if it's still necessary to use mitm? Now I have my own MitM installed on my server, but a popup appears when downloading files. I'm not sure if I need to use MitM and how to close this popup.

ZainChenDev avatar Apr 09 '24 08:04 ZainChenDev

Hey, bro. 这样的话都不需要这个库

harveyjing avatar Nov 10 '24 15:11 harveyjing