mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
apache: HTML Escape the method when showing error message
Tests: - Visit the URL /freedombox/apache/discover-idp/?method=<i>blah</i>. The shown HTML error message escapes the HTML properly with the patch and doesn't without. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
9224786e57
commit
93979feafd
1 file changed
+3
-1
@@ -5,6 +5,7 @@ from urllib.parse import urlencode, urlparse
|
||||
|
||||
from django.http import (HttpResponseBadRequest, HttpResponseRedirect,
|
||||
HttpResponseServerError)
|
||||
from django.utils.html import escape
|
||||
from django.views import View
|
||||
|
||||
from . import setup_oidc_client, validate_host
|
||||
@@ -36,7 +37,8 @@ class DiscoverIDPView(View):
|
||||
oidc_callback = request.GET.get('oidc_callback')
|
||||
|
||||
if method != 'get':
|
||||
return HttpResponseBadRequest(f'Cannot handle "{method}" method')
|
||||
return HttpResponseBadRequest(
|
||||
f'Cannot handle "{escape(method)}" method')
|
||||
|
||||
oidc_callback_parts = urlparse(oidc_callback)
|
||||
request_host = request.get_host()
|
||||
|
||||
Reference in new issue
Block a user