Skip to content

Commit

Permalink
Merge pull request #3 from pyk/run-httpapi-locally
Browse files Browse the repository at this point in the history
Run httpapi locally
  • Loading branch information
pyk committed Apr 29, 2020
2 parents 51884ac + 0e5b84f commit 3a5701d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion samcli/lib/providers/api_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion samcli/local/apigw/local_apigw_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 3a5701d

Please sign in to comment.