File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,9 @@ def parse_batch_req(r):
77
77
abort (http .BAD_REQUEST )
78
78
headers = r ['headers' ]
79
79
80
- has_body = r [ ' method' ] in ('POST' , 'PUT' )
81
- if not has_body and r [ ' method' ] not in ('GET' , 'DELETE' ):
82
- app .logger .warning (f"Bad batch request: invalid request method { r [ ' method' ] } " )
80
+ has_body = method in ('POST' , 'PUT' )
81
+ if not has_body and method not in ('GET' , 'DELETE' ):
82
+ app .logger .warning (f"Bad batch request: invalid request method { method } " )
83
83
abort (http .BAD_REQUEST )
84
84
85
85
if not path .startswith ('/' ):
@@ -89,11 +89,11 @@ def parse_batch_req(r):
89
89
n_bodies = sum (k in r for k in ('b64' , 'json' , 'bytes' ))
90
90
if has_body :
91
91
if not n_bodies :
92
- app .logger .warning (f"Bad batch request: { r [ ' method' ] } requires one of json/b64/bytes" )
92
+ app .logger .warning (f"Bad batch request: { method } requires one of json/b64/bytes" )
93
93
abort (http .BAD_REQUEST )
94
94
elif n_bodies > 1 :
95
95
app .logger .warning (
96
- f"Bad batch request: { r [ ' method' ] } cannot have more than one of json/bytes/b64"
96
+ f"Bad batch request: { method } cannot have more than one of json/bytes/b64"
97
97
)
98
98
abort (http .BAD_REQUEST )
99
99
You can’t perform that action at this time.
0 commit comments