{"record":{"id":"14d39516a4e8f593","repo":"ruvnet/ruflo","slug":"file-type-not-allowed","errorCode":null,"errorMessage":"File type not allowed.","messagePattern":"File type not allowed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte","lineNumber":90,"sourceCode":"\t\t\treturn;\n\t\t}\n\t\tloading = true;\n\t\ttry {\n\t\t\t// Use server proxy directly for one URL to validate size/types before creating File\n\t\t\tconst params = new URLSearchParams({ url: trimmed });\n\t\t\tif (acceptMimeTypes.length > 0) params.set(\"accept\", acceptMimeTypes.join(\",\"));\n\t\t\tconst proxyUrl = `${base}/api/fetch-url?${params}`;\n\t\t\tconst res = await fetch(proxyUrl);\n\t\t\tif (!res.ok) {\n\t\t\t\tconst txt = await res.text();\n\t\t\t\tthrow new Error(txt || `Failed to fetch (${res.status})`);\n\t\t\t}\n\t\t\tconst forwardedType = res.headers.get(\"x-forwarded-content-type\");\n\t\t\tconst blob = await res.blob();\n\t\t\tconst mimeType = pickSafeMime(forwardedType, blob.type, trimmed);\n\t\t\t// Optional client-side mime filter (same wildcard semantics as dropzone)\n\t\t\tif (acceptMimeTypes.length > 0 && mimeType && !matchesAllowed(mimeType, acceptMimeTypes)) {\n\t\t\t\tthrow new Error(\"File type not allowed.\");\n\t\t\t}\n\t\t\tconst disp = res.headers.get(\"content-disposition\");\n\t\t\tconst filename = (() => {\n\t\t\t\tconst filenameStar = disp?.match(/filename\\*=UTF-8''([^;]+)/i)?.[1];\n\t\t\t\tif (filenameStar) {\n\t\t\t\t\tconst cleaned = filenameStar.trim().replace(/['\"]/g, \"\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn decodeURIComponent(cleaned);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn cleaned;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst filenameMatch = disp?.match(/filename=\"?([^\";]+)\"?/i)?.[1];\n\t\t\t\tif (filenameMatch) return filenameMatch.trim();\n\t\t\t\ttry {\n\t\t\t\t\tconst u = new URL(trimmed);\n\t\t\t\t\tconst last = u.pathname.split(\"/\").pop() || \"attachment\";\n\t\t\t\t\treturn decodeURIComponent(last);","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte#L72-L108","documentation":"After fetching through the proxy, the x-forwarded-content-type header (or blob MIME) did not match any of the accepted acceptMimeTypes configured for this attachment flow. The remote file's type is disallowed, so no File object is created and the modal shows the error.","triggerScenarios":"Thrown at ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upload a file whose extension/MIME type is in the allowed list.","Add the file type to the allowlist only after confirming it can be processed safely."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}