Allow downloading Assets with filename in URL #12379

Open
opened 2025-11-02 10:08:00 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @laundmo on GitHub (Jan 24, 2024).

Feature Description

currently Assets like built packages in the various indexes/registries can be downloaded using a URL like https://gitea.example.com/organisation/-/packages/pypi/packagename/0.1.0/files/1

In pip, there is a concept known as "Direct References" which allows installing a package from a remote .whl/zip file, specified like this
requests @ https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl
this works fine in both requirements.txt and pyproject.toml

gitea urls on the other hand error out with

 ERROR: Cannot unpack file TEMP\pip-unpack-i5ps0y5s\1 (downloaded from TEMP\pip-install-a4edpnb9\packagename_asdfkjlas5, content-type: text/html; charset=UTF-8); cannot detect archive format
ERROR: Cannot determine archive format of TEMP\pip-install-a4edpnb9\packagename_asdfkjlas5

because they don't incluede the file extension.

This feature request is for the download links to include the filename and extension, to allow using the repository like this.

Originally created by @laundmo on GitHub (Jan 24, 2024). ### Feature Description currently Assets like built packages in the various indexes/registries can be downloaded using a URL like `https://gitea.example.com/organisation/-/packages/pypi/packagename/0.1.0/files/1` In pip, there is a concept known as "Direct References" which allows installing a package from a remote .whl/zip file, specified like this `requests @ https://files.pythonhosted.org/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl` this works fine in both requirements.txt and pyproject.toml gitea urls on the other hand error out with ``` ERROR: Cannot unpack file TEMP\pip-unpack-i5ps0y5s\1 (downloaded from TEMP\pip-install-a4edpnb9\packagename_asdfkjlas5, content-type: text/html; charset=UTF-8); cannot detect archive format ERROR: Cannot determine archive format of TEMP\pip-install-a4edpnb9\packagename_asdfkjlas5 ``` because they don't incluede the file extension. This feature request is for the download links to include the filename and extension, to allow using the repository like this.
GiteaMirror added the topic/packagestype/proposal labels 2025-11-02 10:08:00 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Jan 24, 2024):

Are you sure the download was successfull? content-type: text/html; charset=UTF-8 doesn't look right.
Additionaly the download provides the correct file name in the header:
7ed18566e1/routers/api/packages/helper/helper.go (L56-L59)

@KN4CK3R commented on GitHub (Jan 24, 2024): Are you sure the download was successfull? `content-type: text/html; charset=UTF-8` doesn't look right. Additionaly the download provides the correct file name in the header: https://github.com/go-gitea/gitea/blob/7ed18566e10b298309dcc99d97447cb1932ae09a/routers/api/packages/helper/helper.go#L56-L59
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12379