Fix code scanning alert no. 1: Incomplete URL substring sanitization
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
7979eecfef
commit
778fca3f70
1 changed files with 7 additions and 5 deletions
|
|
@ -967,7 +967,9 @@ class MarkItDown:
|
|||
- extension: specifies the file extension to use when interpreting the file. If None, infer from source (path, uri, content-type, etc.)
|
||||
"""
|
||||
# Handle GitHub issue URLs directly
|
||||
if isinstance(source, str) and "github.com" in source and "/issues/" in source:
|
||||
if isinstance(source, str):
|
||||
parsed_url = urlparse(source)
|
||||
if parsed_url.hostname == "github.com" and "/issues/" in parsed_url.path:
|
||||
github_token = kwargs.get("github_token", os.getenv("GITHUB_TOKEN"))
|
||||
if not github_token:
|
||||
raise ValueError("GitHub token is required for GitHub issue conversion.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue