| Conditions | 1 |
| Total Lines | 12 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import functools |
||
| 129 | def cache_control(*directives): |
||
| 130 | def decorator(f): |
||
|
1 ignored issue
–
show
|
|||
| 131 | @functools.wraps(f) |
||
|
1 ignored issue
–
show
|
|||
| 132 | def wrapped(*args, **kwargs): |
||
|
1 ignored issue
–
show
|
|||
| 133 | rv = f(*args, **kwargs) |
||
|
1 ignored issue
–
show
|
|||
| 134 | rv = make_response(rv) |
||
|
1 ignored issue
–
show
|
|||
| 135 | rv.headers['Cache-Control'] = ', '.join(directives) |
||
|
1 ignored issue
–
show
|
|||
| 136 | return rv |
||
|
1 ignored issue
–
show
|
|||
| 137 | |||
| 138 | return wrapped |
||
|
1 ignored issue
–
show
|
|||
| 139 | |||
| 140 | return decorator |
||
|
1 ignored issue
–
show
|
|||
| 141 | |||
| 170 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.