| 454 | } |
| 455 | |
| 456 | func (o *Object) applyGetObjectOptions(req *objectstorage.GetObjectRequest, options ...fs.OpenOption) { |
| 457 | fs.FixRangeOption(options, o.bytes) |
| 458 | for _, option := range options { |
| 459 | switch option.(type) { |
| 460 | case *fs.RangeOption, *fs.SeekOption: |
| 461 | _, value := option.Header() |
| 462 | req.Range = &value |
| 463 | default: |
| 464 | if option.Mandatory() { |
| 465 | fs.Logf(o, "Unsupported mandatory option: %v", option) |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | // Apply upload options |
| 470 | for _, option := range options { |
| 471 | key, value := option.Header() |
| 472 | lowerKey := strings.ToLower(key) |
| 473 | switch lowerKey { |
| 474 | case "": |
| 475 | // ignore |
| 476 | case "cache-control": |
| 477 | req.HttpResponseCacheControl = common.String(value) |
| 478 | case "content-disposition": |
| 479 | req.HttpResponseContentDisposition = common.String(value) |
| 480 | case "content-encoding": |
| 481 | req.HttpResponseContentEncoding = common.String(value) |
| 482 | case "content-language": |
| 483 | req.HttpResponseContentLanguage = common.String(value) |
| 484 | case "content-type": |
| 485 | req.HttpResponseContentType = common.String(value) |
| 486 | case "range": |
| 487 | // do nothing |
| 488 | default: |
| 489 | fs.Errorf(o, "Don't know how to set key %q on upload", key) |
| 490 | } |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | func (o *Object) applyMultipartUploadOptions(putReq *objectstorage.PutObjectRequest, req *objectstorage.CreateMultipartUploadRequest) { |
| 495 | req.ContentType = putReq.ContentType |