File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
src/fosslight_dependency/package_manager Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -195,8 +195,7 @@ def parse_oss_information(self, f_name):
195195 else :
196196 npm_url_exists = False
197197 if self ._network_available is True :
198- npm_url_exists = self ._npm_url_exists (oss_init_name )
199-
198+ npm_url_exists = self ._npm_url_exists (oss_init_name , oss_item .version )
200199 if self ._network_available and not npm_url_exists :
201200 oss_item .homepage = repo_url or ""
202201 oss_item .download_location = oss_item .homepage
@@ -242,8 +241,11 @@ def _check_network_available(self) -> bool:
242241 self ._network_available = False
243242 return self ._network_available
244243
245- def _npm_url_exists (self , package_name : str ) -> bool :
246- url = f"https://registry.npmjs.org/{ package_name } "
244+ def _npm_url_exists (self , package_name : str , oss_version = "" ) -> bool :
245+ if oss_version :
246+ url = f"https://registry.npmjs.org/{ package_name } /{ oss_version } "
247+ else :
248+ url = f"https://registry.npmjs.org/{ package_name } "
247249 try :
248250 resp = requests .head (url , timeout = 3 , allow_redirects = True )
249251 if resp .status_code == 405 :
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ def parse_oss_information(self, f_name):
139139 else :
140140 npm_url_exists = False
141141 if self ._network_available is True :
142- npm_url_exists = self ._npm_url_exists (oss_init_name )
142+ npm_url_exists = self ._npm_url_exists (oss_init_name , oss_item . version )
143143
144144 if self ._network_available and not npm_url_exists :
145145 oss_item .homepage = repo_url or ""
You can’t perform that action at this time.
0 commit comments