MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / _validate_vault_upload_filename

Function _validate_vault_upload_filename

Scripts/ButSystem.py:17286–17289  ·  view source on GitHub ↗

Validate/sanitize a vault filename (no file-type blocking).

(filename: str, mime: Optional[str] = None)

Source from the content-addressed store, hash-verified

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

Callers 2

uploadFunction · 0.70
api_upload_initFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected