@@ -9,7 +9,7 @@ use std::sync::LazyLock;
99use futures_lite:: FutureExt ;
1010use hyper:: { header:: HeaderValue , Body , Request , Response } ;
1111use log:: { info, warn} ;
12- use redlib:: client:: { canonical_path, proxy, rate_limit_check, CLIENT } ;
12+ use redlib:: client:: { canonical_path, proxy, rate_limit_check, MEDIA_CLIENT } ;
1313use redlib:: server:: { self , RequestExt } ;
1414use redlib:: utils:: { error, redirect, ThemeAssets } ;
1515use redlib:: { config, duplicates, headers, instance_info, post, search, settings, subreddit, user} ;
@@ -436,18 +436,15 @@ pub async fn proxy_commit_info() -> Result<Response<Body>, String> {
436436#[ cached( time = 600 ) ]
437437async fn fetch_commit_info ( ) -> String {
438438 // wreq uses http v1.x: pass URL as &str and call .send().await, then .bytes().await
439- CLIENT
439+ let bytes = MEDIA_CLIENT
440440 . get ( "https://github.com/redlib-org/redlib/commits/main.atom" )
441441 . send ( )
442442 . await
443443 . expect ( "Failed to request GitHub" )
444444 . bytes ( )
445445 . await
446- . expect ( "Failed to read body" )
447- . iter ( )
448- . copied ( )
449- . map ( |x| x as char )
450- . collect ( )
446+ . expect ( "Failed to read body" ) ;
447+ String :: from_utf8_lossy ( & bytes) . into_owned ( )
451448}
452449
453450pub async fn proxy_instances ( ) -> Result < Response < Body > , String > {
@@ -463,16 +460,13 @@ pub async fn proxy_instances() -> Result<Response<Body>, String> {
463460#[ cached( time = 600 ) ]
464461async fn fetch_instances ( ) -> String {
465462 // wreq uses http v1.x: pass URL as &str and call .send().await, then .bytes().await
466- CLIENT
463+ let bytes = MEDIA_CLIENT
467464 . get ( "https://raw.githubusercontent.com/redlib-org/redlib-instances/refs/heads/main/instances.json" )
468465 . send ( )
469466 . await
470467 . expect ( "Failed to request GitHub" )
471468 . bytes ( )
472469 . await
473- . expect ( "Failed to read body" )
474- . iter ( )
475- . copied ( )
476- . map ( |x| x as char )
477- . collect ( )
470+ . expect ( "Failed to read body" ) ;
471+ String :: from_utf8_lossy ( & bytes) . into_owned ( )
478472}
0 commit comments