Skip to content

GetObjectAsync / WithOffsetAndLength returns error text from server instead of throwing exception #1309

@sebbarg

Description

@sebbarg

GetObjectAsync / WithOffsetAndLength with an out-of-range offset and/or offset+length > long.MaxValue returns an XML formatted error text in the stream instead of throwing an error.

Tested on Hetzner S3 Object Storage.

var offset = 123; // larger than size of the requested object
var length = long.MaxValue;
var getArgs = new GetObjectArgs()
    .WithBucket(BucketName)
    .WithObject(path)
    .WithOffsetAndLength(offset, length)
    .WithCallbackStream(async (stream, ct) =>
    {
        await stream.CopyToAsync(memoryStream, ct);
    });

await _minioClient.GetObjectAsync(getArgs, cancellationToken); 

It should probably throw an exception instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions