Gogs: SVG images are served with wrong MIME type

Created on 9 Jun 2017  路  1Comment  路  Source: gogs/gogs

  • Gogs version (or commit ref): 0.11.18.0608, 0.11.19.0609, 0.11.21.0611 (on try.gogs.io)
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04
  • Database:

    • [ ] PostgreSQL

    • [x] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gogs.io:
  • Log gist (usually found in log/gogs.log): N/A

Description

Embedding SVG images in a repo's README.md does nor work. Instead of the image, the alt text is displayed in the browser (both Firefox and Chromium).

See the test case at try.gogs.io.

The generated HTML is fine. The problem stems from the fact that Gogs serves the SVG file with the HTTP header

Content-Type: text/plain; charset=utf-8

whereas the correct type is image/svg+xml.

馃拪 bug

Most helpful comment

The issue had been previously reported on the Gitea bug tracker.

>All comments

The issue had been previously reported on the Gitea bug tracker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rugk picture rugk  路  3Comments

ceeji picture ceeji  路  3Comments

Cysioland picture Cysioland  路  3Comments

kinglike1337 picture kinglike1337  路  3Comments

fromiuan picture fromiuan  路  3Comments