forked from forgejo/forgejo
Backport #28309 by @KN4CK3R
Fixes https://codeberg.org/forgejo/forgejo/issues/1810
zypper uses HEAD requests to check file existence.
https://github.com/openSUSE/libzypp/blob/HEAD/zypp/RepoManager.cc#L2549
https://github.com/openSUSE/libzypp/blob/HEAD/zypp-curl/ng/network/private/downloaderstates/basicdownloader_p.cc#L116
@ExplodingDragon fyi
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit 5105d2093c
)
This commit is contained in:
parent
171b6a294f
commit
ce3a24ef5f
3 changed files with 35 additions and 2 deletions
|
@ -149,12 +149,18 @@ gpgkey=%sapi/packages/%s/rpm/repository.key`, user.Name, user.Name, setting.AppN
|
|||
|
||||
url := rootURL + "/repodata"
|
||||
|
||||
req := NewRequest(t, "GET", url+"/dummy.xml")
|
||||
req := NewRequest(t, "HEAD", url+"/dummy.xml")
|
||||
MakeRequest(t, req, http.StatusNotFound)
|
||||
|
||||
req = NewRequest(t, "GET", url+"/dummy.xml")
|
||||
MakeRequest(t, req, http.StatusNotFound)
|
||||
|
||||
t.Run("repomd.xml", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
req = NewRequest(t, "HEAD", url+"/repomd.xml")
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
req = NewRequest(t, "GET", url+"/repomd.xml")
|
||||
resp := MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue