diff --git a/lambdas/service/app.py b/lambdas/service/app.py index ff28052173..ecac27bd90 100644 --- a/lambdas/service/app.py +++ b/lambdas/service/app.py @@ -1274,7 +1274,7 @@ def get_summary(): def manifest_route(*, fetch: bool, method: str): - initiate = method in ['PUT', 'POST'] + initiate = method in {'PUT', 'POST'} return app.route( # The path parameter could be a token *or* an object key, but we don't # want to complicate the API with this detail @@ -1549,7 +1549,7 @@ def fetch_file_manifest_with_token(token: str): def _file_manifest(fetch: bool, token_or_key: Optional[str] = None): request = app.current_request - require(request.method != 'POST' or request.raw_body.decode() == '', + require(request.method != 'POST' or request.raw_body == b'', 'The body must be empty for a POST request to this endpoint.') query_params = request.query_params or {} _hoist_parameters(query_params, request)