Skip to content

Commit 5d93530

Browse files
Merge branch 'master' into zero_size_encrypted_object
2 parents 987f118 + 9127574 commit 5d93530

7 files changed

+13
-3
lines changed

api-put-object.go

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type PutObjectOptions struct {
3838
ContentType string
3939
ContentEncoding string
4040
ContentDisposition string
41+
ContentLanguage string
4142
CacheControl string
4243
EncryptMaterials encrypt.Materials
4344
NumThreads uint
@@ -71,6 +72,9 @@ func (opts PutObjectOptions) Header() (header http.Header) {
7172
if opts.ContentDisposition != "" {
7273
header["Content-Disposition"] = []string{opts.ContentDisposition}
7374
}
75+
if opts.ContentLanguage != "" {
76+
header["Content-Language"] = []string{opts.ContentLanguage}
77+
}
7478
if opts.CacheControl != "" {
7579
header["Cache-Control"] = []string{opts.CacheControl}
7680
}

api-put-object_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func TestPutObjectOptionsValidate(t *testing.T) {
4040
{"Content-Encoding", "gzip", false},
4141
{"Cache-Control", "blah", false},
4242
{"Content-Disposition", "something", false},
43+
{"Content-Language", "somelanguage", false},
4344

4445
// Valid metadata names.
4546
{"my-custom-header", "blah", true},

api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type Options struct {
9999
// Global constants.
100100
const (
101101
libraryName = "minio-go"
102-
libraryVersion = "4.0.8"
102+
libraryVersion = "4.0.9"
103103
)
104104

105105
// User Agent should always following the below style.

core.go

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ func (c Core) PutObject(bucket, object string, data io.Reader, size int64, md5Ba
7878
opts.ContentEncoding = v
7979
} else if strings.ToLower(k) == "content-disposition" {
8080
opts.ContentDisposition = v
81+
} else if strings.ToLower(k) == "content-language" {
82+
opts.ContentLanguage = v
8183
} else if strings.ToLower(k) == "content-type" {
8284
opts.ContentType = v
8385
} else if strings.ToLower(k) == "cache-control" {

docs/API.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ __minio.PutObjectOptions__
584584
| `opts.ContentType` | _string_ | Content type of object, e.g "application/text" |
585585
| `opts.ContentEncoding` | _string_ | Content encoding of object, e.g "gzip" |
586586
| `opts.ContentDisposition` | _string_ | Content disposition of object, "inline" |
587+
| `opts.ContentLanguage` | _string_ | Content language of object, e.g "French" |
587588
| `opts.CacheControl` | _string_ | Used to specify directives for caching mechanisms in both requests and responses e.g "max-age=600"|
588589
| `opts.EncryptMaterials` | _encrypt.Materials_ | Interface provided by `encrypt` package to encrypt a stream of data (For more information see https://godoc.org/github.com/minio/minio-go) |
589590
| `opts.StorageClass` | _string_ | Specify storage class for the object. Supported values for Minio server are `REDUCED_REDUNDANCY` and `STANDARD` |
@@ -629,7 +630,7 @@ __Parameters__
629630
|`objectName` | _string_ |Name of the object |
630631
|`reader` | _io.Reader_ |Any Go type that implements io.Reader |
631632
|`objectSize`| _int64_ | size of the object being uploaded. Pass -1 if stream size is unknown |
632-
|`opts` | _minio.PutObjectOptions_ |Pointer to struct that allows user to set optional custom metadata, content-type, content-encoding,content-disposition and cache-control headers, pass encryption module for encrypting objects, and optionally configure number of threads for multipart put operation. |
633+
|`opts` | _minio.PutObjectOptions_ |Pointer to struct that allows user to set optional custom metadata, content-type, content-encoding, content-disposition, content-language and cache-control headers, pass encryption module for encrypting objects, and optionally configure number of threads for multipart put operation. |
633634

634635

635636
__Example__
@@ -911,7 +912,7 @@ __Parameters__
911912
|`bucketName` | _string_ |Name of the bucket |
912913
|`objectName` | _string_ |Name of the object |
913914
|`filePath` | _string_ |Path to file to be uploaded |
914-
|`opts` | _minio.PutObjectOptions_ |Pointer to struct that allows user to set optional custom metadata, content-type, content-encoding,content-disposition and cache-control headers, pass encryption module for encrypting objects, and optionally configure number of threads for multipart put operation. |
915+
|`opts` | _minio.PutObjectOptions_ |Pointer to struct that allows user to set optional custom metadata, content-type, content-encoding, content-disposition, content-language and cache-control headers, pass encryption module for encrypting objects, and optionally configure number of threads for multipart put operation. |
915916

916917

917918
__Example__

utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ var supportedHeaders = []string{
221221
"cache-control",
222222
"content-encoding",
223223
"content-disposition",
224+
"content-language",
224225
// Add more supported headers here.
225226
}
226227

utils_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ func TestIsStandardHeader(t *testing.T) {
312312
{"content-type", true},
313313
{"cache-control", true},
314314
{"content-disposition", true},
315+
{"content-language", true},
315316
{"random-header", false},
316317
}
317318

0 commit comments

Comments
 (0)