From 18748808c98c95f938660119237d359837ea69d2 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Mon, 18 Jul 2022 18:47:38 +0200 Subject: [PATCH] =?UTF-8?q?[fix]=C2=A0argument=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ halfapi/lib/acl.py | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2794cdc..bc92b77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # HalfAPI +## 0.6.20 + +- Fix arguments handling + ## 0.6.19 - Allow file sending in multipart request (#32) diff --git a/halfapi/lib/acl.py b/halfapi/lib/acl.py index 80b2916..745a144 100644 --- a/halfapi/lib/acl.py +++ b/halfapi/lib/acl.py @@ -70,7 +70,7 @@ def args_check(fct): pass elif content_type in [ 'multipart/form-data', 'application/x-www-form-urlencoded']: - data_ = await req.form() + data_ = dict(await req.form()) else: data_ = await req.body() @@ -99,14 +99,14 @@ def args_check(fct): optional = args_d.get('optional', set()) for key in optional: - if key in data_: - data[key] = data_[key] - else: - """ Unsafe mode, without specified arguments, or plain text mode - """ - data = data_ + if key in data_: + data[key] = data_[key] + else: + """ Unsafe mode, without specified arguments, or plain text mode + """ + data = data_ - kwargs['data'] = data + kwargs['data'] = data if req.scope.get('out'): kwargs['out'] = req.scope.get('out').copy()