Skip to content

Add 30s timeout to requests.get() HTTP call#1999

Open
bencodess wants to merge 1 commit into
microsoft:mainfrom
bencodess:main
Open

Add 30s timeout to requests.get() HTTP call#1999
bencodess wants to merge 1 commit into
microsoft:mainfrom
bencodess:main

Conversation

@bencodess
Copy link
Copy Markdown

Description

The convert_uri() method in MarkItDown makes a requests.get() call with stream=True but no timeout. This means a request to a slow or malicious server can hang indefinitely, blocking the process.

Added timeout=30 to the call at _markitdown.py:475. This matches standard practice — requests itself has no default timeout, which is a well-known footgun. 30 seconds is generous enough for large files while preventing indefinite hangs.

@bencodess bencodess mentioned this pull request May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant