Remove `preferences` arg from opensearch template

When a browser adds a search engine using the opensearch template, it
does not have the correct context necessary to autofill the
`preferences` arg with the user's session prefs. As a result, queries
made using the browser bar will have the instance's default preferences
filled into the template.

Removing this shouldn't have any side effects, since queries made on the
same machine will have the correct session associated with the user.

Fixes #929
main
Ben Busby 2023-03-06 15:33:28 -07:00
parent baa8bd0eb4
commit f7c4381ba6
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
2 changed files with 1 additions and 5 deletions

View File

@ -251,8 +251,7 @@ def opensearch():
main_url=opensearch_url, main_url=opensearch_url,
request_type='' if get_only else 'method="post"', request_type='' if get_only else 'method="post"',
search_type=request.args.get('tbm'), search_type=request.args.get('tbm'),
search_name=get_search_name(request.args.get('tbm')), search_name=get_search_name(request.args.get('tbm'))
preferences=g.user_config.preferences
), 200, {'Content-Type': 'application/xml'} ), 200, {'Content-Type': 'application/xml'}

View File

@ -17,9 +17,6 @@
{% if search_type %} {% if search_type %}
<Param name="tbm" value="{{ search_type }}"/> <Param name="tbm" value="{{ search_type }}"/>
{% endif %} {% endif %}
{% if preferences %}
<Param name="preferences" value="{{ preferences }}"/>
{% endif %}
</Url> </Url>
<Url type="application/x-suggestions+json" {{ request_type|safe }} template="{{ main_url }}/autocomplete"> <Url type="application/x-suggestions+json" {{ request_type|safe }} template="{{ main_url }}/autocomplete">
<Param name="q" value="{searchTerms}"/> <Param name="q" value="{searchTerms}"/>