[PR #3049] [MERGED] Refactor URL validation function #7969

Closed
opened 2025-11-11 17:41:30 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/3049
Author: @que-nguyen
Created: 6/12/2024
Status: Merged
Merged: 6/12/2024
Merged by: @tjbck

Base: devHead: dev


📝 Commits (1)

  • eb7bba8 Refactor URL validation function

📊 Changes

1 file changed (+7 additions, -23 deletions)

View changed files

📝 backend/apps/rag/main.py (+7 -23)

📄 Description

  • The check for private IP addresses often did not yield the expected results, especially with errors like: [Errno -2] Name or service not known. (related #2839)
  • Removed the check for private IP addresses in the URL validation process.
  • Simplified the validate_url function to focus on validating the URL format and checking the existence of the URL using a HEAD request. Checking with HEAD requests is generally faster and more accurate as it validates whether the web resource actually exists.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/3049 **Author:** [@que-nguyen](https://github.com/que-nguyen) **Created:** 6/12/2024 **Status:** ✅ Merged **Merged:** 6/12/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`eb7bba8`](https://github.com/open-webui/open-webui/commit/eb7bba81fe6a4ee6ec8baa57d21963b1b8bd650e) Refactor URL validation function ### 📊 Changes **1 file changed** (+7 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `backend/apps/rag/main.py` (+7 -23) </details> ### 📄 Description - The check for private IP addresses often did not yield the expected results, especially with errors like: `[Errno -2] Name or service not known`. (related [#2839](https://github.com/open-webui/open-webui/issues/2839)) - Removed the check for private IP addresses in the URL validation process. - Simplified the `validate_url` function to focus on validating the URL format and checking the existence of the URL using a HEAD request. Checking with HEAD requests is generally faster and more accurate as it validates whether the web resource actually exists. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 17:41:30 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#7969