Skip to content

Commit

Permalink
Merge pull request #98 from buildkite/correctly-encode-urls
Browse files Browse the repository at this point in the history
Correct encode backslashes in URLs
  • Loading branch information
toolmantim committed Apr 7, 2015
2 parents ba6152e + 26b2efc commit 0fd95d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion buildkite/s3_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"io/ioutil"
"os"
"strings"
"net/url"
)

type S3Uploader struct {
Expand Down Expand Up @@ -84,7 +85,11 @@ func (u *S3Uploader) Setup(destination string) error {
}

func (u *S3Uploader) URL(artifact *Artifact) string {
return "http://" + u.bucketName() + ".s3.amazonaws.com/" + u.artifactPath(artifact)
url, _ := url.Parse("http://" + u.bucketName() + ".s3.amazonaws.com")

url.Path += u.artifactPath(artifact)

return url.String()
}

func (u *S3Uploader) Upload(artifact *Artifact) error {
Expand Down

0 comments on commit 0fd95d7

Please sign in to comment.