0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-21 23:03:39 +01:00
gitea/services/packages
Zettat123 898f852d03
Fix missing signature key error when pulling Docker images with SERVE_DIRECT enabled (#32365) (#32397)
Backport #32365

Fix #28121

I did some tests and found that the `missing signature key` error is
caused by an incorrect `Content-Type` header. Gitea correctly sets the
`Content-Type` header when serving files.


348d1d0f32/routers/api/packages/container/container.go (L712-L717)
However, when `SERVE_DIRECT` is enabled, the `Content-Type` header may
be set to an incorrect value by the storage service. To fix this issue,
we can use query parameters to override response header values.

https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html <img
width="600px"

src="https://github.com/user-attachments/assets/f2ff90f0-f1df-46f9-9680-b8120222c555"
/>

In this PR, I introduced a new parameter to the `URL` method to support
additional parameters.

```
URL(path, name string, reqParams url.Values) (*url.URL, error)
```
2024-11-01 03:53:59 +00:00
..
alpine Integrate alpine noarch packages into other architectures index (#29137) 2024-02-25 15:10:55 +00:00
cargo Fix reverting a merge commit failing (#28794) 2024-01-16 15:06:51 +00:00
cleanup remove util.OptionalBool and related functions (#29513) 2024-03-02 16:42:31 +01:00
container remove util.OptionalBool and related functions (#29513) 2024-03-02 16:42:31 +01:00
debian Fix debian InRelease Acquire-By-Hash newline (#29204) 2024-02-17 05:40:13 +00:00
rpm Do not escape relative path in RPM primary index (#32038) (#32054) 2024-09-17 08:19:35 +08:00
auth.go Fix nuget/conan/container packages upload bugs (#31967) (#31982) 2024-09-05 07:34:41 +00:00
packages.go Fix missing signature key error when pulling Docker images with SERVE_DIRECT enabled (#32365) (#32397) 2024-11-01 03:53:59 +00:00