From 29dfd9679b11c68384ef5f90d1880780352037e6 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 23 Oct 2015 23:07:36 +0200 Subject: [PATCH] [fix] use base_url in http redirects - closes #451 --- searx/webapp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index 07750456d..794b7ea8c 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -42,7 +42,7 @@ except: from datetime import datetime, timedelta from urllib import urlencode -from urlparse import urlparse +from urlparse import urlparse, urljoin from werkzeug.contrib.fixers import ProxyFix from flask import ( Flask, request, render_template, url_for, Response, make_response, @@ -531,7 +531,7 @@ def preferences(): blocked_engines = [] - resp = make_response(redirect(url_for('index'))) + resp = make_response(redirect(urljoin(settings['server']['base_url'], url_for('index')))) if request.method == 'GET': blocked_engines = get_blocked_engines(engines, request.cookies) @@ -766,7 +766,7 @@ def favicon(): @app.route('/clear_cookies') def clear_cookies(): - resp = make_response(redirect(url_for('index'))) + resp = make_response(redirect(urljoin(settings['server']['base_url'], url_for('index')))) for cookie_name in request.cookies: resp.delete_cookie(cookie_name) return resp