Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions service/Abstractions/Pipeline/MimeTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public static class FileExtensions
public interface IMimeTypeDetection
{
public string GetFileType(string filename);
public bool TryGetFileType(string filename, out string? mimeType);
}

public class MimeTypesDetection : IMimeTypeDetection
Expand Down Expand Up @@ -222,4 +223,9 @@ public string GetFileType(string filename)

throw new NotSupportedException($"File type not supported: {filename}");
}

public bool TryGetFileType(string filename, out string? mimeType)
{
return s_extensionTypes.TryGetValue(Path.GetExtension(filename), out mimeType);
}
}