This commit is contained in:
Gert Wohlgemuth 2018-05-23 00:25:51 -07:00
commit 2e3e827bc6
2 changed files with 5 additions and 4 deletions

View File

@ -121,9 +121,8 @@ def code(event, context):
if "Items" in response and len(response['Items']) > 0: if "Items" in response and len(response['Items']) > 0:
if response['Items'][0]["public"]: if response['Items'][0]["public"]:
content = urlsafe_b64decode(response['Items'][0]['content']) content = urlsafe_b64decode(response['Items'][0]['content']).decode('utf-8')
return content
return str(content)
else: else:
return { return {
"statusCode": 403, "statusCode": 403,

View File

@ -126,6 +126,7 @@ functions:
path: strategies/{user}/{name}/code path: strategies/{user}/{name}/code
method: get method: get
cors: true cors: true
integration: lambda
request: request:
parameter: parameter:
paths: paths:
@ -134,6 +135,7 @@ functions:
response: response:
headers: headers:
Content-Type: "'text/plain'" Content-Type: "'text/plain'"
template: $input.path('$')
environment: environment:
strategyTable: ${self:custom.strategyTable} strategyTable: ${self:custom.strategyTable}