Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Add timeout for get request

Daoud Clarked8642e20329f
diff --git a/devdata/index-v2.tinysearch b/devdata/index-v2.tinysearch
index 550f6ad..5a9cf2f 100644
Binary files a/devdata/index-v2.tinysearch and b/devdata/index-v2.tinysearch differ
diff --git a/mwmbl/views.py b/mwmbl/views.py
index 8c32e31..33a2402 100644
--- a/mwmbl/views.py
+++ b/mwmbl/views.py
@@ -116,7 +116,7 @@ def add_url(request):
query = request.POST["query"]
try:
- response = requests.get(new_url)
+ response = requests.get(new_url, timeout=5)
except RequestException:
return HttpResponseBadRequest("Could not fetch URL")