1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-19 17:53:16 +00:00

http: add basic metadata and provide it via serve

Co-authored-by: dougal <147946567+roucc@users.noreply.github.com>
This commit is contained in:
Oleg Kunitsyn
2025-11-17 17:52:30 +01:00
committed by GitHub
parent 80e6389a50
commit ecea0cd6f9
9 changed files with 232 additions and 12 deletions

View File

@@ -87,6 +87,7 @@ func TestMemoryObject(t *testing.T) {
content = content[:6] // make some extra cap
o := object.NewMemoryObject(remote, now, content)
o.WithMimeType("text/plain; charset=utf-8")
assert.Equal(t, content, o.Content())
assert.Equal(t, object.MemoryFs, o.Fs())
@@ -95,6 +96,7 @@ func TestMemoryObject(t *testing.T) {
assert.Equal(t, now, o.ModTime(context.Background()))
assert.Equal(t, int64(len(content)), o.Size())
assert.Equal(t, true, o.Storable())
assert.Equal(t, "text/plain; charset=utf-8", o.MimeType(context.Background()))
Hash, err := o.Hash(context.Background(), hash.MD5)
assert.NoError(t, err)