mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-10 14:09:05 -06:00
groupware: jmap: fix id -> blobId attribute when uploading a blob
This commit is contained in:
@@ -44,7 +44,7 @@ func (j *Client) GetBlobMetadata(accountId string, session *Session, ctx context
|
||||
}
|
||||
|
||||
type UploadedBlob struct {
|
||||
Id string `json:"id"`
|
||||
BlobId string `json:"blobId"`
|
||||
Size int `json:"size"`
|
||||
Type string `json:"type"`
|
||||
Sha512 string `json:"sha:512"`
|
||||
@@ -133,7 +133,7 @@ func (j *Client) UploadBlob(accountId string, session *Session, ctx context.Cont
|
||||
get := getResponse.List[0]
|
||||
|
||||
return UploadedBlob{
|
||||
Id: upload.Id,
|
||||
BlobId: upload.Id,
|
||||
Size: upload.Size,
|
||||
Type: upload.Type,
|
||||
Sha512: get.DigestSha512,
|
||||
|
||||
@@ -125,7 +125,7 @@ func (t TestJmapBlobClient) UploadBinary(ctx context.Context, logger *log.Logger
|
||||
hasher := sha512.New()
|
||||
hasher.Write(bytes)
|
||||
return UploadedBlob{
|
||||
Id: uuid.NewString(),
|
||||
BlobId: uuid.NewString(),
|
||||
Size: len(bytes),
|
||||
Type: contentType,
|
||||
Sha512: base64.StdEncoding.EncodeToString(hasher.Sum(nil)),
|
||||
|
||||
Reference in New Issue
Block a user