Skip to content

Commit

Permalink
fix: avoid duplicate headers in nvd_api
Browse files Browse the repository at this point in the history
Signed-off-by: Terri Oda <[email protected]>
  • Loading branch information
terriko committed Jul 28, 2023
1 parent 8cc81eb commit f404a17
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cve_bin_tool/nvd_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ def __init__(
if self.api_version == "1.0":
# API key is passed as URL parameter
self.params["apiKey"] = self.api_key
self.header = None
self.header = HTTP_HEADERS
else:
# API key is passed as part of header
self.header = {}
self.header = HTTP_HEADERS
self.header["apiKey"] = self.api_key
else:
# Because of rate limiting
self.max_hosts = 1
self.header = {}
self.header = HTTP_HEADERS

@staticmethod
def convert_date_to_nvd_date(date: datetime) -> str:
Expand Down Expand Up @@ -155,7 +155,6 @@ async def get_nvd_params(
self.session = RateLimiter(
aiohttp.ClientSession(
connector=connector,
headers=HTTP_HEADERS,
trust_env=True,
timeout=connection_timeout,
headers=self.header,
Expand Down

0 comments on commit f404a17

Please sign in to comment.