Skip to content

Initial chars in readme misinterpreted as audio file #17108

Closed
@epistemex

Description

@epistemex

Gitea Version

1.15.2 built with GNU Make 4.1, go1.16.7

Git Version

not relevant

Operating System

Debian 10/x64

How are you running Gitea?

apt install / locally

Database

SQLite

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

When uploading a readme.md file starting with ID3 the file is mistaken for an MP3 audio file. Example content

ID3Toy
======

Read and write ID3 tags (v1.0, v1.1, v2.0, v2.3, v2.4), APE (v1, v2) and LYRICS 3 tags (v1, v2) in MP3 files.
...

(MP3 files may start with ID3 tag but shouldn't be used to identify such files to begin with, but that's another issue :) )

So my README.md files shows up as raw file:

2021-09-20_18-36

and clicking on the file line itself shows me the audio player:

2021-09-20_18-36_1

The content of the readme file is correct, verified and is just text (the example above is a direct copy from it). :)

Screenshots

Network activity snapshot

2021-09-20_18-44

Adding a new-line at the top of the file acts as a workaround and Gitea accepts the file properly as text/md file:

2021-09-20_19-47

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions