File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,7 +62,10 @@ pub fn parse_index_tar_gz(path: &str) -> Result<Vec<Package>> {
6262pub fn fetch_remote_index ( repo_url : & str , arch : & str ) -> Result < Vec < Package > > {
6363 let url = format ! ( "{}/{}/APKINDEX.tar.gz" , repo_url. trim_end_matches( '/' ) , arch) ;
6464
65- let resp = ureq:: get ( & url) . call ( ) . map_err ( |e| anyhow ! ( "HTTP request failed: {e}" ) ) ?;
65+ let resp = ureq:: get ( & url)
66+ . set ( "User-Agent" , & format ! ( "vellum-cli/{}" , env!( "VELLUM_VERSION" ) ) )
67+ . call ( )
68+ . map_err ( |e| anyhow ! ( "HTTP request failed: {e}" ) ) ?;
6669
6770 if resp. status ( ) != 200 {
6871 return Err ( anyhow ! ( "HTTP {}" , resp. status( ) ) ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ struct AppState {
3131}
3232
3333fn main ( ) {
34+ unsafe { env:: set_var ( "HTTP_USER_AGENT" , format ! ( "vellum-cli/{VERSION}" ) ) ; }
35+
3436 let state = State :: new ( VELLUM_ROOT ) ;
3537 let apk = Apk :: new ( VELLUM_ROOT ) ;
3638
You can’t perform that action at this time.
0 commit comments