GitFOSS
refactor(repository): make sure getRepositoryFileContents returns correct mimeType
+ 10
- 4
@@ -1,5 +1,5 @@
 {
-  "_generatedAtUnix": 1663770423607,
+  "_generatedAtUnix": 1663770947993,
   "_hashAlgorithm": "sha1",
   "_version": 2,
   "islands": {

...
@@ -50,7 +50,7 @@
       "pathSource": "./app/views/auth/RegisterView.tsx"
     },
     "RepositoryBrowserView": {
-      "hash": "d9f8ac892f78a75e1f7f2a1cb82602fb87dafd72",
+      "hash": "2d4e879f98bd3a8316e1e86bd97baee50e515b2e",
       "pathSource": "./app/views/repository/RepositoryBrowserView.tsx"
     },
     "RepositoryCommitsLogView": {

app/services/repository/getRepositoryFileContent.ts
@@ -60,9 +60,15 @@ const makeGetRepositoryFileContent: ServiceMethodFactory<
         });
       });
 
+      const { mimeType } =
+        await request.codeAnalysisService.getLinguistFileInfos(
+          path,
+          gitCatFileResult
+        );
+
       return {
         content: gitCatFileResult,
-        mimeType: "mime/not-yet-supported",
+        mimeType,
       };
     } catch (_) {
       return null;

app/views/repository/RepositoryBrowserView.tsx
@@ -63,7 +63,7 @@ const RepositoryBrowserView: ReactView<RepositoryBrowserViewProps> = ({
           </Grid.Row>
           {linguistInfos.type === "image" ? (
             <img
-              src={`data:image/${linguistInfos.mimeType};base64,${Buffer.from(
+              src={`data:${fileContent.mimeType};base64,${Buffer.from(
                 fileContent.content
               ).toString("base64")}`}
               style={{ width: "100%", height: "auto" }}

new file
public/assets/bitmaps/jest.png