From 5930f097af559846a774bae1621f4dc3d4168254 Mon Sep 17 00:00:00 2001 From: KaseiFR Date: Sat, 2 Apr 2022 15:35:43 +0200 Subject: [PATCH 1/2] server: remove Firefox workaround in torrent data handler The Firefox bug was fixed in version 87. --- server/routes/api/torrents.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/server/routes/api/torrents.ts b/server/routes/api/torrents.ts index 7898c2a27..e75785706 100644 --- a/server/routes/api/torrents.ts +++ b/server/routes/api/torrents.ts @@ -706,17 +706,14 @@ router.get<{hash: string; indices: string}, unknown, unknown, {token: string}>( const {hash, indices: stringIndices} = req.params; if (req.user != null && req.query.token == null) { - // https://bugzilla.mozilla.org/show_bug.cgi?id=1689018 - if (req.headers?.['user-agent']?.includes('Firefox/') !== true) { - res.redirect( - `?token=${getToken({ - username: req.user.username, - hash, - indices: stringIndices, - })}`, - ); - return res; - } + res.redirect( + `?token=${getToken({ + username: req.user.username, + hash, + indices: stringIndices, + })}`, + ); + return res; } const selectedTorrent = req.services.torrentService.getTorrent(hash); From a788b794a299a18d7539c66152e19e9df6f4376d Mon Sep 17 00:00:00 2001 From: KaseiFR Date: Sat, 2 Apr 2022 17:50:37 +0200 Subject: [PATCH 2/2] Fix torrent download extension override The API data handler streaming feature is now opt-in, and controls whether the file type is overridden. --- .../general/filesystem/DirectoryFileList.tsx | 2 +- .../torrent-details-modal/TorrentContents.tsx | 34 ++++-------- server/routes/api/torrents.ts | 52 +++++++++---------- 3 files changed, 38 insertions(+), 50 deletions(-) diff --git a/client/src/javascript/components/general/filesystem/DirectoryFileList.tsx b/client/src/javascript/components/general/filesystem/DirectoryFileList.tsx index d068e7d95..39fa20b64 100644 --- a/client/src/javascript/components/general/filesystem/DirectoryFileList.tsx +++ b/client/src/javascript/components/general/filesystem/DirectoryFileList.tsx @@ -65,7 +65,7 @@ const DirectoryFiles: FC = ({depth, items, hash, path, onIt
{/* TODO: Add a WebAssembly decoding player if the feature is popular */} { }} /> -