From cfb9967d372fea53c07c8b6cd3fe42288dbfb3c7 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 20 Dec 2021 13:55:00 +0100 Subject: [PATCH] [FIX] website_forum: set return content-type The request being of type http, the returned Content-Type was text/html while the select2 request exepected json in the dataType --- addons/website_forum/controllers/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 70d76cd8654..ffdcb2d8782 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -185,7 +185,10 @@ class WebsiteForum(WebsiteProfile): fields=['id', 'name'], limit=int(limit), ) - return json.dumps(data) + return request.make_response( + json.dumps(data), + headers=[("Content-Type", "application/json")] + ) @http.route(['/forum//tag', '/forum//tag/'], type='http', auth="public", website=True, sitemap=False) def tags(self, forum, tag_char=None, **post):