Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better version of load_endpoints func #411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ghunt/objects/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ def _load_endpoint(self, endpoint_name: str,
for ext_type,ext_value in ext_metadata.items():
ext_bin_headers = {f"X-Goog-Ext-{k}-{ext_type.title()}":v for k,v in ext_value.items()}
headers = {**headers, **ext_bin_headers}

if not is_headers_syntax_good(headers):
raise GHuntCorruptedHeadersError(f"The provided headers when loading the endpoint seems corrupted, please check it : {headers}")

self.loaded_endpoints[endpoint_name] = EndpointConfig(headers, self.cookies)


async def _check_and_gen_authorization_token(self, as_client: httpx.AsyncClient, creds: GHuntCreds):
async with self.gen_token_lock:
present = False
Expand Down Expand Up @@ -149,4 +150,4 @@ def recursive_merge(obj1, obj2, module_name: str) -> any:
if not get_class_name(obj).startswith(class_name):
raise GHuntObjectsMergingError("The two objects being merged aren't from the same class.")

self = recursive_merge(self, obj, module_name)
self = recursive_merge(self, obj, module_name)