@@ -34,6 +34,7 @@ class StacValidate:
34
34
links (bool): Whether to additionally validate links (only works in default mode).
35
35
assets (bool): Whether to additionally validate assets (only works in default mode).
36
36
assets_open_urls (bool): Whether to open assets URLs when validating assets.
37
+ headers (dict): HTTP headers to include in the requests.
37
38
extensions (bool): Whether to only validate STAC object extensions.
38
39
custom (str): The local filepath or remote URL of a custom JSON schema to validate the STAC object.
39
40
verbose (bool): Whether to enable verbose output in recursive mode.
@@ -56,6 +57,7 @@ def __init__(
56
57
links : bool = False ,
57
58
assets : bool = False ,
58
59
assets_open_urls : bool = True ,
60
+ headers : dict = {},
59
61
extensions : bool = False ,
60
62
custom : str = "" ,
61
63
verbose : bool = False ,
@@ -70,6 +72,7 @@ def __init__(
70
72
self .links = links
71
73
self .assets = assets
72
74
self .assets_open_urls = assets_open_urls
75
+ self .headers : Dict = headers
73
76
self .recursive = recursive
74
77
self .max_depth = max_depth
75
78
self .extensions = extensions
@@ -125,7 +128,7 @@ def assets_validator(self) -> Dict:
125
128
assets = self .stac_content .get ("assets" )
126
129
if assets :
127
130
for asset in assets .values ():
128
- link_request (asset , initial_message , self .assets_open_urls )
131
+ link_request (asset , initial_message , self .assets_open_urls , self . headers )
129
132
return initial_message
130
133
131
134
def links_validator (self ) -> Dict :
@@ -145,7 +148,7 @@ def links_validator(self) -> Dict:
145
148
for link in self .stac_content ["links" ]:
146
149
if not is_valid_url (link ["href" ]):
147
150
link ["href" ] = root_url + link ["href" ][1 :]
148
- link_request (link , initial_message )
151
+ link_request (link , initial_message , True , self . headers )
149
152
150
153
return initial_message
151
154
0 commit comments