Skip to content

Add timeout to requests.get call#70

Draft
deshibel wants to merge 1 commit into
mainfrom
dd/add-timeout-to-requests-get
Draft

Add timeout to requests.get call#70
deshibel wants to merge 1 commit into
mainfrom
dd/add-timeout-to-requests-get

Conversation

@deshibel
Copy link
Copy Markdown

Code Security (SAST) • View in Code Security (SAST)

This PR addresses a security vulnerability in the get_product_from_api function where the requests.get call was missing a timeout parameter. Without a timeout, the request could hang indefinitely if the server is unresponsive, leading to potential denial-of-service risks.

Changes made:

  • Added timeout=5 to the requests.get call to ensure requests fail fast if the server does not respond within 5 seconds.

This aligns with security best practices by preventing indefinite blocking of HTTP requests.


PR by Bits - View session in Datadog

Comment @DataDog to request changes

Co-authored-by: deshibel <68776367+deshibel@users.noreply.github.com>
@datadog-datadog-demo-org
Copy link
Copy Markdown

View session in Datadog

Bits Dev status: ✅ Done

CI Auto-fix: Disabled | Enable

Comment @DataDog to request changes

@datadog-datadog-demo-org
Copy link
Copy Markdown

I can only run on private repositories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant