Преглед изворни кода

[mod][fix] using base_url instead of hostname in settings.py

asciimoo пре 11 година
родитељ
комит
32512856b4
2 измењених фајлова са 3 додато и 3 уклоњено
  1. 1
    1
      searx/settings.py
  2. 2
    2
      searx/webapp.py

+ 1
- 1
searx/settings.py Прегледај датотеку

@@ -13,4 +13,4 @@ blacklist = [] # search engine blacklist
13 13
 
14 14
 categories = {} # custom search engine categories
15 15
 
16
-hostname = None # domain name or None - if you want to rewrite the default HTTP host
16
+base_url = None # "https://your.domain.tld/" or None (to use request parameters)

+ 2
- 2
searx/webapp.py Прегледај датотеку

@@ -165,8 +165,8 @@ def opensearch():
165 165
         method = 'get'
166 166
     if request.is_secure:
167 167
         scheme = 'https'
168
-    if settings.hostname:
169
-        hostname = '{0}://{1}/'.format(scheme,settings.hostname)
168
+    if settings.base_url:
169
+        hostname = settings.base_url
170 170
     else:
171 171
         hostname = url_for('index', _external=True, _scheme=scheme)
172 172
     ret = opensearch_xml.format(method=method, host=hostname)