mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-01-12 07:52:47 +00:00
fixes to ham talm
This commit is contained in:
parent
a1e68edb91
commit
6a62101fad
@ -261,9 +261,12 @@ def get_telem_full(event, context):
|
|||||||
"queryStringParameters" in event
|
"queryStringParameters" in event
|
||||||
and "datetime" in event["queryStringParameters"]
|
and "datetime" in event["queryStringParameters"]
|
||||||
):
|
):
|
||||||
|
try:
|
||||||
requested_time = datetime.fromisoformat(
|
requested_time = datetime.fromisoformat(
|
||||||
event["queryStringParameters"]["datetime"].replace("Z", "+00:00")
|
event["queryStringParameters"]["datetime"].replace("Z", "+00:00")
|
||||||
)
|
)
|
||||||
|
except: # might be in unix time
|
||||||
|
requested_time = datetime.utcfromtimestamp(float(event["queryStringParameters"]["datetime"]))
|
||||||
else:
|
else:
|
||||||
requested_time = datetime.now(timezone.utc)
|
requested_time = datetime.now(timezone.utc)
|
||||||
|
|
||||||
@ -383,10 +386,11 @@ def get_telem_full(event, context):
|
|||||||
return {
|
return {
|
||||||
"body": body,
|
"body": body,
|
||||||
"isBase64Encoded": True,
|
"isBase64Encoded": True,
|
||||||
"statusCode": 400,
|
"statusCode": 200,
|
||||||
"headers": {
|
"headers": {
|
||||||
"Content-Encoding": "gzip",
|
"Content-Encoding": "gzip",
|
||||||
"content-type": content_type
|
"Content-Disposition": "attachment",
|
||||||
|
"Content-Type": content_type
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user