Fix 'Missing credentials parameter' bug : request.POST is buggy when value contains special chars ... request.params appears to be more reliable

This commit is contained in:
Alexandre Aubin 2021-11-15 18:07:46 +01:00
parent fc4b31bdea
commit c5f577c04f

View file

@ -393,14 +393,11 @@ class _ActionsMapPlugin(object):
""" """
credentials = request.POST.credentials if "credentials" not in request.params:
# Apparently even if the key doesn't exists, request.POST.foobar just returns empty string...
if not credentials:
raise HTTPResponse("Missing credentials parameter", 400) raise HTTPResponse("Missing credentials parameter", 400)
credentials = request.params["credentials"]
profile = request.POST.profile profile = request.params.get("profile", self.actionsmap.default_authentication)
if not profile:
profile = self.actionsmap.default_authentication
authenticator = self.actionsmap.get_authenticator(profile) authenticator = self.actionsmap.get_authenticator(profile)