Content scanner also checks for thumbnails (#5911)

* scan also thumbnails for medias

* pr suggestion
This commit is contained in:
Mauro
2026-07-22 16:43:08 +02:00
committed by GitHub
parent cff46137b9
commit 6967f99626
12 changed files with 155 additions and 17 deletions
@@ -26,6 +26,10 @@ nonisolated struct ContentScannerProxy: ContentScannerProxyProtocol {
do {
let response = try await contentScanner.scan(client: client, mediaSource: mediaSource.underlyingSource)
return .success(response.clean)
} catch ClientError.ContentScanner(.mcsMimeTypeForbidden, _), ClientError.ContentScanner(.mcsMediaNotClean, _) {
// The server flagged the media as unsafe (dangerous content or a forbidden mime type),
// which we treat as an unsafe verdict rather than a scan failure.
return .success(false)
} catch {
MXLog.error("Failed scanning media content: \(error)")
return .failure(.sdkError(error))