diff --git a/internal/pipe/blob/blob.go b/internal/pipe/blob/blob.go index 6c4f1d5b1..e5dd74a97 100644 --- a/internal/pipe/blob/blob.go +++ b/internal/pipe/blob/blob.go @@ -33,9 +33,13 @@ func (Pipe) Default(ctx *context.Context) error { if blob.Directory == "" { blob.Directory = "{{ .ProjectName }}/{{ .Tag }}" } + if blob.ContentDisposition == "" { blob.ContentDisposition = "attachment;filename={{.Filename}}" + } else if blob.ContentDisposition == "-" { + blob.ContentDisposition = "" } + if blob.OldDisableSSL { deprecate.Notice(ctx, "blobs.disableSSL") blob.DisableSSL = true diff --git a/internal/pipe/blob/blob_test.go b/internal/pipe/blob/blob_test.go index d63070d7d..bbdf25c71 100644 --- a/internal/pipe/blob/blob_test.go +++ b/internal/pipe/blob/blob_test.go @@ -75,8 +75,9 @@ func TestDefaults(t *testing.T) { ContentDisposition: "inline", }, { - Bucket: "foobar", - Provider: "gcs", + Bucket: "foobar", + Provider: "gcs", + ContentDisposition: "-", }, { Bucket: "deprecated", @@ -100,7 +101,7 @@ func TestDefaults(t *testing.T) { Bucket: "foobar", Provider: "gcs", Directory: "{{ .ProjectName }}/{{ .Tag }}", - ContentDisposition: "attachment;filename={{.Filename}}", + ContentDisposition: "", }, { Bucket: "deprecated", diff --git a/www/docs/customization/blob.md b/www/docs/customization/blob.md index 0a95856cb..f5d97ac8e 100644 --- a/www/docs/customization/blob.md +++ b/www/docs/customization/blob.md @@ -116,6 +116,7 @@ blobs: # Since: v1.24 # Default: attachment;filename={{.Filename}} # Templates: allowed + # Disable by setting the value to '-' content_disposition: "inline" - provider: gs