소스 검색

[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)