Skip to content

index.py throws exception if RAW_DATA not defined #37

@chasewalden

Description

@chasewalden

os.getenv('RAW_BODY') returns None if not defined, causing a TypeError in python3-flask-debian (potentially in others)

File "index.py", line 13, in is_true
    return len(val) > 0 and val.lower() == "true" or val == "1"
TypeError: object of type 'NoneType' has no len()

https://github.com/openfaas-incubator/python-flask-template/blob/7f9288a527b4c2b8acabb2271c38c4d3745d4310/template/python3-flask-debian/index.py#L12-L13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions