1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-07-15 01:34:38 +02:00

fix(golangBuild): use PUT instead of POST (#3504)

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
This commit is contained in:
Christian Volk
2022-02-04 14:46:52 +01:00
committed by GitHub
parent 54ca265860
commit a90cf78565
2 changed files with 6 additions and 5 deletions

View File

@ -39,10 +39,6 @@ func (utils golangBuildMockUtils) SetOptions(options piperhttp.ClientOptions) {
}
func (utils golangBuildMockUtils) UploadRequest(method, url, file, fieldName string, header http.Header, cookies []*http.Cookie, uploadType string) (*http.Response, error) {
return nil, fmt.Errorf("not implemented")
}
func (utils golangBuildMockUtils) UploadFile(url, file, fieldName string, header http.Header, cookies []*http.Cookie, uploadType string) (*http.Response, error) {
utils.fileUploads[file] = url
response := http.Response{
@ -52,6 +48,10 @@ func (utils golangBuildMockUtils) UploadFile(url, file, fieldName string, header
return &response, utils.returnFileUploadError
}
func (utils golangBuildMockUtils) UploadFile(url, file, fieldName string, header http.Header, cookies []*http.Cookie, uploadType string) (*http.Response, error) {
return utils.UploadRequest(http.MethodPut, url, file, fieldName, header, cookies, uploadType)
}
func (utils golangBuildMockUtils) Upload(data piperhttp.UploadRequestData) (*http.Response, error) {
return nil, fmt.Errorf("not implemented")
}