From c6f06a9f295b196f52e9029a4852f7a1ee9a51ac Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Wed, 7 Feb 2024 22:29:47 +0100 Subject: [PATCH] Revert "feat: Proxy episodes when they are behind an unsecure http server" This reverts commit 2398c9749d5d26a5315ece22cb94f92fb11caaad. --- appinfo/routes.php | 1 - lib/Controller/EpisodesController.php | 9 --------- src/store/player.js | 5 +---- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index 16101f6..eb63e71 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -15,7 +15,6 @@ return [ ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], ['name' => 'episodes#action', 'url' => '/episodes/action', 'verb' => 'GET'], ['name' => 'episodes#list', 'url' => '/episodes/list', 'verb' => 'GET'], - ['name' => 'episodes#proxy', 'url' => '/episodes/proxy', 'verb' => 'GET'], ['name' => 'opml#export', 'url' => '/opml/export', 'verb' => 'GET'], ['name' => 'opml#import', 'url' => '/opml/import', 'verb' => 'POST'], ['name' => 'podcast#index', 'url' => '/podcast', 'verb' => 'GET'], diff --git a/lib/Controller/EpisodesController.php b/lib/Controller/EpisodesController.php index a06478a..8a47a6d 100644 --- a/lib/Controller/EpisodesController.php +++ b/lib/Controller/EpisodesController.php @@ -12,7 +12,6 @@ use OCA\RePod\Service\UserService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; -use OCP\AppFramework\Http\StreamResponse; use OCP\Http\Client\IClientService; use OCP\IRequest; @@ -47,12 +46,4 @@ class EpisodesController extends Controller return new JSONResponse([], Http::STATUS_NOT_FOUND); } - - /** - * @NoAdminRequired - * @NoCSRFRequired - */ - public function proxy(string $url): StreamResponse { - return new StreamResponse(fopen($url, 'r')); - } } diff --git a/src/store/player.js b/src/store/player.js index b541ccb..93113d5 100644 --- a/src/store/player.js +++ b/src/store/player.js @@ -49,10 +49,7 @@ export const player = { if (episode) { state.podcastUrl = decodeUrl(router.currentRoute.params.url) - const proxyUrl = new URL(episode.url) - audio.src = location.protocol === 'https:' && proxyUrl.protocol === 'http:' - ? generateUrl('/apps/repod/episodes/proxy?url={url}', { url: episode.url }) - : episode.url + audio.src = episode.url audio.load() audio.play()