Validate/sanitize a vault filename (no file-type blocking).
(filename: str, mime: Optional[str] = None)
| 17284 | mime = "application/octet-stream" |
| 17285 | |
| 17286 | try: |
| 17287 | if is_encrypted_file(sp): |
| 17288 | gen = aesgcm_decrypt_generator(sp) |
| 17289 | resp = Response(gen, mimetype=mime) |
| 17290 | resp.headers["Content-Disposition"] = f'attachment; filename="{filename}"' |
| 17291 | else: |
| 17292 | from flask import send_file |
no outgoing calls
no test coverage detected