浏览代码

Fixes #271

The opensearch method is now the method set in the preferences.

As before, POST by default and GET for Chrome/Chromium which doesn't
handle POST
Luc Didry 10 年前
父节点
当前提交
7004de6aa7
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      searx/webapp.py

+ 4
- 0
searx/webapp.py 查看文件

687
 @app.route('/opensearch.xml', methods=['GET'])
687
 @app.route('/opensearch.xml', methods=['GET'])
688
 def opensearch():
688
 def opensearch():
689
     method = 'post'
689
     method = 'post'
690
+
691
+    if request.cookies.get('method', 'POST') == 'GET':
692
+        method = 'get'
693
+
690
     # chrome/chromium only supports HTTP GET....
694
     # chrome/chromium only supports HTTP GET....
691
     if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
695
     if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
692
         method = 'get'
696
         method = 'get'