Some files are recognized as SVG incorrectly, make the diff UI unable to work. #8966

Closed
opened 2025-11-02 08:24:17 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @stuzer05 on GitHub (May 17, 2022).

Description

When certain conditions are met gitea can't display the blade.php file diff when viewing the commit. It only works when I click "View source button". Second link is taken from network, it is causing the crash.

f97b3784f8
e2f752e123/test.blade.php

image

Gitea Version

1.17.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker

Database

No response

Originally created by @stuzer05 on GitHub (May 17, 2022). ### Description When certain conditions are met gitea can't display the `blade.php` file diff when viewing the commit. It only works when I click "View source button". Second link is taken from network, it is causing the crash. https://try.gitea.io/stuzer05/test-preview/commit/f97b3784f8c8efc222128f6dffd4e5abb5fda462 https://try.gitea.io/stuzer05/test-preview/raw/commit/e2f752e123151fea55959571d56d57462025f0f6/test.blade.php ![image](https://user-images.githubusercontent.com/23124682/168754789-1967dae8-908e-488c-86cd-dbb63ce5f867.png) ### Gitea Version 1.17.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Docker ### Database _No response_
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 08:24:17 -06:00
Author
Owner

@wxiaoguang commented on GitHub (May 17, 2022):

The file was recognized as SVG incorrectly.

https://try.gitea.io/stuzer05/test-preview/raw/commit/e2f752e123151fea55959571d56d57462025f0f6/test.blade.php

Response header:

content-type | image/svg+xml

@wxiaoguang commented on GitHub (May 17, 2022): The file was recognized as SVG incorrectly. `https://try.gitea.io/stuzer05/test-preview/raw/commit/e2f752e123151fea55959571d56d57462025f0f6/test.blade.php` Response header: `content-type | image/svg+xml`
Author
Owner

@lunny commented on GitHub (May 17, 2022):

By the extension name, it's not a svg file.

@lunny commented on GitHub (May 17, 2022): By the extension name, it's not a svg file.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8966