Add HEAD
support for rpm repo files (#28309)
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
This commit is contained in:
parent
0aab2d38a7
commit
a95d5b7702
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