Added content type to SetRequest struct
This commit is contained in:
parent
4d3e4ebee5
commit
ecfbbd58ad
|
@ -225,6 +225,12 @@ func (r *StateStore) writeFile(req *state.SetRequest) error {
|
|||
blobURL := r.containerURL.NewBlockBlobURL(getFileName(req.Key))
|
||||
|
||||
var blobHTTPHeaders azblob.BlobHTTPHeaders
|
||||
|
||||
if req.ContentType != nil && req.ContentType != "" {
|
||||
blobHTTPHeaders.ContentType = req.ContentType
|
||||
}
|
||||
|
||||
// this is for backward compatibility where it might have come from http request
|
||||
if val, ok := req.Metadata[contentType]; ok && val != "" {
|
||||
blobHTTPHeaders.ContentType = val
|
||||
delete(req.Metadata, contentType)
|
||||
|
|
|
@ -48,6 +48,7 @@ type SetRequest struct {
|
|||
ETag *string `json:"etag,omitempty"`
|
||||
Metadata map[string]string `json:"metadata,omitempty"`
|
||||
Options SetStateOption `json:"options,omitempty"`
|
||||
ContentType string `json:"contentType,omitempty"`
|
||||
}
|
||||
|
||||
// GetKey gets the Key on a SetRequest
|
||||
|
|
|
@ -10,6 +10,7 @@ type GetResponse struct {
|
|||
Data []byte `json:"data"`
|
||||
ETag *string `json:"etag,omitempty"`
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
ContentType string `json:"contentType,omitempty"`
|
||||
}
|
||||
|
||||
// BulkGetResponse is the response object for bulk get response.
|
||||
|
|
Loading…
Reference in New Issue