File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,10 +75,14 @@ private function tryFetchImageBlob(PodcastData $data): ?string {
7575 }
7676
7777 private function fetchUrl (string $ url ): IResponse {
78- $ resp = $ this ->httpClient ->get ($ url );
78+ $ resp = $ this ->httpClient ->get ($ url, [ ' headers ' => [ ' User-Agent ' => ' nextcloud-gpodder (+https://nextcloud.com; like iTMS) ' ]] );
7979 $ statusCode = $ resp ->getStatusCode ();
8080 if ($ statusCode < 200 || $ statusCode >= 300 ) {
81- throw new \ErrorException ("Web request returned non-2xx status code: $ statusCode " );
81+ $ resp = $ this ->httpClient ->get ($ url , ['headers ' => ['User-Agent ' => 'nextcloud-gpodder (+https://nextcloud.com) ' ]]);
82+ $ statusCode = $ resp ->getStatusCode ();
83+ if ($ statusCode < 200 || $ statusCode >= 300 ) {
84+ throw new \ErrorException ("Web request returned non-2xx status code: $ statusCode " );
85+ }
8286 }
8387 return $ resp ;
8488 }
You can’t perform that action at this time.
0 commit comments