profiler_export. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.
()
| 15950 | |
| 15951 | mime = row["mime"] or "audio/webm" |
| 15952 | try: |
| 15953 | if is_encrypted_file(sp): |
| 15954 | gen = aesgcm_decrypt_generator(sp) |
| 15955 | resp = Response(gen, mimetype=mime) |
| 15956 | else: |
| 15957 | from flask import send_file |
| 15958 | resp = send_file(sp, mimetype=mime, as_attachment=False, conditional=True, max_age=0) |
| 15959 | except Exception: |
| 15960 | abort(404) |
| 15961 | |
| 15962 | resp.headers["Cache-Control"] = "no-store" |
| 15963 | return resp |
| 15964 | |
| 15965 | |
| 15966 | # ---------- |
| 15967 | # ----------------- |
| 15968 | # Profiler (text encrypted; attachments plaintext) |
| 15969 | # --------------------------- |
| 15970 | |
| 15971 | |
| 15972 | # ---------------- Profiler optional fields helpers ---------------- |
| 15973 | |
| 15974 | PROFILER_OPTIONAL_KEYS = [ |
| 15975 | "phone", "email", "car_model", "license_plate", "id_number", |
| 15976 | "height_cm", "weight_kg", "eye_color", "hair_color", "job", |
| 15977 | "country", "state", "town", "address", "family_members", "close_friends" ] |
| 15978 | |
| 15979 | def profiler_collect_optional(form) -> Dict[str, str]: |
| 15980 | """profiler_collect_optional. |
| 15981 | |
| 15982 | Internal helper function. |
| 15983 | |
| 15984 | This docstring was added automatically to improve maintainability. |
| 15985 | |
| 15986 | Args: |
| 15987 | form: Parameter. |
| 15988 | |
| 15989 | Returns: |
| 15990 | Varies. |
| 15991 | """ |
| 15992 | def clean(s: str) -> str: |
| 15993 | """clean. |
| 15994 | |
| 15995 | Internal helper function. |
| 15996 | |
| 15997 | This docstring was added automatically to improve maintainability. |
| 15998 | |
| 15999 | Args: |
| 16000 | s: Parameter. |
| 16001 | |
| 16002 | Returns: |
| 16003 | Varies. |
| 16004 | """ |
| 16005 | return (s or "").strip() |
| 16006 | |
| 16007 | out: Dict[str, str] = {} |
| 16008 | out["phone"] = clean(form.get("opt_phone")) |
| 16009 | out["email"] = clean(form.get("opt_email")) |
nothing calls this directly
no test coverage detected