Client errors on malformed object #17

Closed
opened 2025-12-28 18:11:57 +00:00 by sami · 1 comment
Owner

Originally created by @alexvanin on GitHub (Oct 15, 2020).

With this object initialization SDK does not return errors.

hdr := new(object2.Header)
hdr.SetContainerID(cid.ToV2())
hdr.SetSessionToken(tok.ToV2())
hdr.SetOwnerID(ownerID.ToV2())

objID := object.NewID()
obj := new(object2.Object)
obj.SetObjectID(objID.ToV2())
obj.SetHeader(hdr)

oid, err := cli.PutObject(ctx,
	new(client.PutObjectParams).
		WithObject(object.NewFromV2(obj)).
		WithPayloadReader(f),
	client.WithSession(tok))

However it sends malformed request and gets error response can't classify request sender. Is it correct behavior for client? Seems like yes, because it just takes malformed v2/object and sends it straight away. You should either use pkg/object or prepare correct v2/object structure. But maybe there are different opinions on this.

Originally created by @alexvanin on GitHub (Oct 15, 2020). With this object initialization SDK does not return errors. ```go hdr := new(object2.Header) hdr.SetContainerID(cid.ToV2()) hdr.SetSessionToken(tok.ToV2()) hdr.SetOwnerID(ownerID.ToV2()) objID := object.NewID() obj := new(object2.Object) obj.SetObjectID(objID.ToV2()) obj.SetHeader(hdr) oid, err := cli.PutObject(ctx, new(client.PutObjectParams). WithObject(object.NewFromV2(obj)). WithPayloadReader(f), client.WithSession(tok)) ``` However it sends malformed request and gets error response `can't classify request sender`. Is it correct behavior for client? Seems like yes, because it just takes malformed `v2/object` and sends it straight away. You should either use `pkg/object` or prepare correct `v2/object` structure. But maybe there are different opinions on this.
sami 2025-12-28 18:11:57 +00:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@alexvanin commented on GitHub (Nov 16, 2020):

Seems like a legit client behavior. Close due to monthly inactivity.

@alexvanin commented on GitHub (Nov 16, 2020): Seems like a legit client behavior. Close due to monthly inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-api-go#17
No description provided.