lambda-decorators icon indicating copy to clipboard operation
lambda-decorators copied to clipboard

Multipe domain & wildcard support for CORS

Open dschep opened this issue 6 years ago • 0 comments

Enable usage like this, list of domains & support wildcards in strings:

    >>> @cors_headers(origin=['https://example.com', 'https://*.example.com'])
    ... def hello_custom_origin(example, context):
    ...     return {'body': 'foobar'}
    >>> hello_custom_origin({'headers': {'Host': 'https://foobar.example.com'}}, object())
    {'body': 'foobar', 'headers': {'Access-Control-Allow-Origin': 'https://foobar.example.com'}

dschep avatar Nov 05 '19 16:11 dschep