Ensure Content-Type correctness #64

Closed
opened 2025-12-28 18:14:02 +00:00 by sami · 0 comments
Owner

Originally created by @roman-khimov on GitHub (Jan 20, 2025).

I'm always frustrated when frontend returns obscure errors for simple requests. Uploading a binary file can result in

"writer close: status: code = 2048 message = access to object operation denied"

in cases where we know the request will fail in advance. One of such cases is missing/wrong Content-Type.

Describe the solution you'd like

Check Content-Type prior to upload:

Describe alternatives you've considered

No alternatives.

Originally created by @roman-khimov on GitHub (Jan 20, 2025). ## Is your feature request related to a problem? Please describe. I'm always frustrated when frontend returns obscure errors for simple requests. Uploading a binary file can result in ``` "writer close: status: code = 2048 message = access to object operation denied" ``` in cases where we know the request will fail in advance. One of such cases is missing/wrong Content-Type. ## Describe the solution you'd like Check Content-Type prior to upload: * do not allow to upload objects with Content-Type from this list: https://github.com/nspcc-dev/neofs-oauthz/blob/678efff06128fa585e3ac2aa271e1b448023d090/bearer/bearer.go#L56 * in case it's missing add `application/octet-stream` type which works fine for most purposes ## Describe alternatives you've considered No alternatives.
sami 2025-12-28 18:14:02 +00:00
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/send-fs-neo-org#64
No description provided.