Skip to content

Commit 7b19269

Browse files
rajasblackmdrxy
andauthored
feat: add SSL verification option to recursive link fetching (#46)
In the current implementation of the method _get_child_links_recursive, the requests.get call doesn't accept verify as a parameter. This does not allow users to disable SSL certificate verification when needed. Please consider exposing the verify parameter as a configurable argument to the method, defaulting to True for safety, but allowing users to override it when necessary. https://github.com/langchain-ai/langchain-community/blob/bc87773064735e649cfd798185502e156d5e948a/libs/community/langchain_community/document_loaders/recursive_url_loader.py#L376-L377 --------- Co-authored-by: Mason Daugherty <[email protected]>
1 parent d803fc4 commit 7b19269

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/community/langchain_community/document_loaders/recursive_url_loader.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,11 @@ def _get_child_links_recursive(
408408
visited.add(url)
409409
try:
410410
response = requests.get(
411-
url, timeout=self.timeout, headers=self.headers, proxies=self.proxies
411+
url,
412+
timeout=self.timeout,
413+
headers=self.headers,
414+
proxies=self.proxies,
415+
verify=self.ssl,
412416
)
413417

414418
if self.encoding is not None:
@@ -488,7 +492,7 @@ async def _async_get_child_links_recursive(
488492
)
489493
visited.add(url)
490494
try:
491-
async with session.get(url) as response:
495+
async with session.get(url, ssl=self.ssl) as response:
492496
text = await response.text()
493497
if self.check_response_status and 400 <= response.status <= 599:
494498
raise ValueError(f"Received HTTP status {response.status}")

0 commit comments

Comments
 (0)