Skip to content

Commit

Permalink
Possibly fixed by force-setting content type
Browse files Browse the repository at this point in the history
  • Loading branch information
Eltik committed Jul 2, 2023
1 parent b9b8e8f commit 9231dba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/libraries/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ async function proxyM3U8(url, headers, res) {
["Access-Control-Allow-Origin", "Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age", "Access-Control-Allow-Credentials", "Access-Control-Expose-Headers", "Access-Control-Request-Method", "Access-Control-Request-Headers", "Origin", "Vary", "Referer", "Server", "x-cache", "via", "x-amz-cf-pop", "x-amz-cf-id"].map((header) => res.removeHeader(header));
// You need these headers so that the client recognizes the response as an m3u8.
res.setHeader("Content-Type", "application/vnd.apple.mpegurl");
res.setHeader("Content-Disposition", `attachment; filename="filename.jpg"`);
res.setHeader("Content-Type", "video/mp2t");
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Headers", "*");
res.setHeader("Access-Control-Allow-Methods", "*");
Expand Down Expand Up @@ -579,7 +579,7 @@ async function proxyM3U8(url, headers, res) {
["Access-Control-Allow-Origin", "Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age", "Access-Control-Allow-Credentials", "Access-Control-Expose-Headers", "Access-Control-Request-Method", "Access-Control-Request-Headers", "Origin", "Vary", "Referer", "Server", "x-cache", "via", "x-amz-cf-pop", "x-amz-cf-id"].map((header) => res.removeHeader(header));
// You need these headers so that the client recognizes the response as an m3u8.
res.setHeader("Content-Type", "application/vnd.apple.mpegurl");
res.setHeader("Content-Disposition", `attachment; filename="filename.jpg"`);
res.setHeader("Content-Type", "video/mp2t");
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Headers", "*");
res.setHeader("Access-Control-Allow-Methods", "*");
Expand Down
Loading

0 comments on commit 9231dba

Please sign in to comment.