Skip to content

Commit

Permalink
Merge pull request #78 from liron-shalom/go-publish-checksum
Browse files Browse the repository at this point in the history
Go Publish : Calculate and add checksum headers to published files.
  • Loading branch information
eyalbe4 authored Sep 24, 2019
2 parents cc2a372 + 1f915ef commit 21de331
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions artifactory/services/go/publishzipandmod.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
rthttpclient "github.com/jfrog/jfrog-client-go/artifactory/httpclient"
"github.com/jfrog/jfrog-client-go/artifactory/services/utils"
"github.com/jfrog/jfrog-client-go/utils/errorutils"
"github.com/jfrog/jfrog-client-go/utils/io/fileutils"
"github.com/jfrog/jfrog-client-go/utils/io/httputils"
"github.com/jfrog/jfrog-client-go/utils/version"
"net/http"
Expand Down Expand Up @@ -73,6 +74,11 @@ func (pwa *publishZipAndModApi) upload(localPath, moduleId, version, props, ext,
return err
}
addGoVersion(version, &urlPath)
details, err := fileutils.GetFileDetails(localPath)
if err != nil {
return err
}
utils.AddChecksumHeaders(pwa.clientDetails.Headers, details)
resp, _, err := pwa.client.UploadFile(localPath, urlPath, "", &pwa.clientDetails, GoUploadRetries, nil)
if err != nil {
return err
Expand Down

0 comments on commit 21de331

Please sign in to comment.