Revert "feat: Proxy episodes when they are behind an unsecure http server"
All checks were successful
repod / xml (push) Successful in 23s
repod / php (push) Successful in 55s
repod / nodejs (push) Successful in 2m17s
repod / release (push) Has been skipped

This reverts commit 2398c9749d.
This commit is contained in:
Michel Roux 2024-02-07 22:29:47 +01:00
parent a16556c0eb
commit c6f06a9f29
3 changed files with 1 additions and 14 deletions

View File

@ -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'],

View File

@ -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'));
}
}

View File

@ -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()