Return HTTP 400 if missing query parameters
This commit is contained in:
parent
891db049af
commit
ffcde09b97
1 changed files with 5 additions and 0 deletions
|
@ -116,6 +116,11 @@ def genImageFromURL(urlArray):
|
|||
return finalImg
|
||||
|
||||
def lambda_handler(event, context):
|
||||
if ("queryStringParameters" not in event):
|
||||
return {
|
||||
"statusCode": 400,
|
||||
"body": "Invalid request."
|
||||
}
|
||||
images = event["queryStringParameters"].get("imgs","").split(",")
|
||||
for img in images:
|
||||
if not img.startswith("https://pbs.twimg.com"):
|
||||
|
|
Loading…
Reference in a new issue