diff --git a/samcli/lib/providers/api_collector.py b/samcli/lib/providers/api_collector.py index 6f1446a9df..50a6bc4fc1 100644 --- a/samcli/lib/providers/api_collector.py +++ b/samcli/lib/providers/api_collector.py @@ -158,7 +158,9 @@ def dedupe_function_routes(routes): if config: methods += config.methods sorted_methods = sorted(methods) - grouped_routes[key] = Route(function_name=route.function_name, path=route.path, methods=sorted_methods) + grouped_routes[key] = Route( + function_name=route.function_name, path=route.path, methods=sorted_methods, event_type=route.event_type + ) return list(grouped_routes.values()) def add_binary_media_types(self, logical_id, binary_media_types): diff --git a/samcli/local/apigw/local_apigw_service.py b/samcli/local/apigw/local_apigw_service.py index bf67db303d..64285bab2b 100644 --- a/samcli/local/apigw/local_apigw_service.py +++ b/samcli/local/apigw/local_apigw_service.py @@ -484,7 +484,7 @@ def _construct_event_http(flask_request, port, binary_types, stage_name=None, st LOG.debug("Incoming Request seems to be binary. Base64 encoding the request data before sending to Lambda.") request_data = base64.b64encode(request_data) - if request_data: + if request_data is not None: # Flask does not parse/decode the request data. We should do it ourselves request_data = request_data.decode("utf-8")