gitea/routers/web/repo
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
..
actions Fix `missing signature key` error when pulling Docker images with `SERVE_DIRECT` enabled (#32365) (#32397) 2024-11-01 03:53:59 +00:00
setting Don't return 500 if mirror url contains special chars (#31859) (#31895) 2024-08-22 00:10:50 +08:00
activity.go
attachment.go Fix `missing signature key` error when pulling Docker images with `SERVE_DIRECT` enabled (#32365) (#32397) 2024-11-01 03:53:59 +00:00
blame.go
branch.go
cherry_pick.go
code_frequency.go
commit.go
compare.go
contributors.go
download.go Fix `missing signature key` error when pulling Docker images with `SERVE_DIRECT` enabled (#32365) (#32397) 2024-11-01 03:53:59 +00:00
editor.go
editor_test.go
find.go
fork.go
githttp.go Fix wrong last modify time (#32102) (#32104) 2024-09-22 19:12:57 +00:00
githttp_test.go
helper.go
helper_test.go
issue.go Fix Bug in Issue/pulls list (#32081) (#32115) 2024-09-24 01:26:10 +00:00
issue_content_history.go
issue_dependency.go
issue_label.go
issue_label_test.go
issue_lock.go
issue_pin.go
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go
main_test.go
middlewares.go
migrate.go Fix javascript error when an anonymous user visiting migration page (#32144) (#32179) 2024-10-04 17:58:04 +00:00
milestone.go
packages.go
patch.go
projects.go
projects_test.go
pull.go Avoid returning without written ctx when posting PR (#31843) (#31848) 2024-08-16 13:50:12 -04:00
pull_review.go
pull_review_test.go
recent_commits.go
release.go
release_test.go
render.go Fix rendered wiki page link (#31398) (#31407) 2024-06-19 11:23:24 +08:00
repo.go Fix `missing signature key` error when pulling Docker images with `SERVE_DIRECT` enabled (#32365) (#32397) 2024-11-01 03:53:59 +00:00
search.go
search_test.go
topic.go
treelist.go
view.go Fix rendered wiki page link (#31398) (#31407) 2024-06-19 11:23:24 +08:00
view_test.go
wiki.go Fix raw wiki links (#31825) (#31845) 2024-08-17 03:19:26 +00:00
wiki_test.go Fix raw wiki links (#31825) (#31845) 2024-08-17 03:19:26 +00:00