@@ -492,6 +492,10 @@ def is_usable_module(self, name):
492492 def cfg_version (self , default ):
493493 return PPG .config .get_value ("%s-version" % self .m_name ) or default
494494
495+ def cfg_http_headers (self ):
496+ if config_http_headers := PPG .config .get_value ("%s-http-headers" % self .m_name ):
497+ return config_http_headers
498+
495499 def cfg_url (self , version ):
496500 if config_url := PPG .config .get_value ("%s-url" % self .m_name ):
497501 url_template = Template (config_url )
@@ -643,7 +647,14 @@ def compile(self):
643647 https_proxy = os .environ .get ("HTTPS_PROXY" ) or os .environ .get ("https_proxy" )
644648 if https_proxy :
645649 proxies ["https" ] = https_proxy
646- RestClient ().download (self .url , path , proxies = proxies )
650+
651+ expanded_url = os .path .expandvars (self .url )
652+ expanded_http_headers = {}
653+ if headers := self .cfg_http_headers ():
654+ for header_dict in headers :
655+ for key , value in header_dict .items ():
656+ expanded_http_headers [os .path .expandvars (key )] = os .path .expandvars (value )
657+ RestClient ().download (expanded_url , path , proxies = proxies , headers = expanded_http_headers )
647658
648659 runez .decompress (path , self .m_src_build , simplify = True )
649660
0 commit comments