Skip to content
Open
Show file tree
Hide file tree
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modification in this file seems redundant since this endpoint is not used.

Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,8 @@ class DatasetResource {
val contentType = decodedPathStr.split("\\.").lastOption.map(_.toLowerCase) match {
case Some("jpg") | Some("jpeg") => "image/jpeg"
case Some("png") => "image/png"
case Some("webp") => "image/webp"
case Some("gif") => "image/gif"
case Some("csv") => "text/csv"
case Some("md") => "text/markdown"
case Some("txt") => "text/plain"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const MIME_TYPES = {
JPEG: "image/jpeg",
JPG: "image/jpeg",
PNG: "image/png",
WEBP: "image/webp",
GIF: "image/gif",
CSV: "text/csv",
TXT: "text/plain",
MD: "text/markdown",
Expand All @@ -55,6 +57,8 @@ export function getMimeType(filename: string): string {
export const MIME_TYPE_SIZE_LIMITS_MB = {
[MIME_TYPES.JPEG]: 5 * 1024 * 1024, // 5 MB
[MIME_TYPES.PNG]: 5 * 1024 * 1024, // 5 MB
[MIME_TYPES.WEBP]: 5 * 1024 * 1024, // 5 MB
[MIME_TYPES.GIF]: 10 * 1024 * 1024, // 10 MB
[MIME_TYPES.CSV]: 2 * 1024 * 1024, // 2 MB for text-based data files
[MIME_TYPES.TXT]: 1 * 1024 * 1024, // 1 MB for plain text files
[MIME_TYPES.MD]: 1 * 1024 * 1024, // 1 MB for MD files
Expand Down Expand Up @@ -200,6 +204,8 @@ export class UserDatasetFileRendererComponent implements OnInit, OnChanges, OnDe
switch (blobMimeType) {
case MIME_TYPES.PNG:
case MIME_TYPES.JPEG:
case MIME_TYPES.WEBP:
case MIME_TYPES.GIF:
this.displayImage = true;
this.loadSafeURL(blob);
break;
Expand Down