Closed
Description
Description
When trying to mirror some old packages into a maven repository, we ran into an error when trying to upload ISO-8859-1-encoded pom XML files:
2023/07/10 16:54:52 ...kages/maven/maven.go:328:UploadPackageFile() [E] [64ac1bbc-4] Error parsing package metadata: xml: encoding "ISO-8859-1" declared but Decoder.CharsetReader is nil
While this will probably not happen with modern Maven versions, one might run into this problem when trying to cache/host old artifacts inside Gitea.
To Reproduce
- Get commons-jxpath-1.3 jar and pom from https://repo1.maven.org/maven2/commons-jxpath/commons-jxpath/1.3/
- Try to deploy to Gitea:
mvn deploy:deploy-file -Dfile=commons-jxpath-1.3.jar -DrepositoryId=gitea -Durl=https://try.gitea.io/api/packages/encoding/maven -DpomFile=commons-jxpath-1.3.pom
- Receive
500 Internal Server Error
(https://gist.github.com/TobiX/08ba809cb6d27df8aa5e85d0f3633b01) - Repository view is now also broken: https://try.gitea.io/encoding/-/packages/maven/commons-jxpath-commons-jxpath/1.3
Gitea Version
1.19.4
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
2.39.2
Operating System
Debian 12 (bookworm)
How are you running Gitea?
- Downloaded from https://dl.gitea.com/gitea/1.19.4/
- Running with systemd, listening on a UNIX socket
- Caddy as reverse proxy
Database
PostgreSQL