mirror of
https://github.com/nspcc-dev/neofs-http-gw.git
synced 2026-03-01 12:37:26 +00:00
Implement POST method support for objects upload #6
Labels
No labels
I1
I3
I4
S2
S3
S4
U2
U2
U3
U4
blocked
bug
config
documentation
enhancement
go
good first issue
help wanted
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-http-gw#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @realloc on GitHub (Jan 21, 2021).
Uploads has to use POST method, because PUT must be idempotent. When we upload through HTTP protocol gate, the actual object created at NeoFS protocol level may have different resulting ObjectID, hence there may be different result with different side-effects and this doesn't confirm the expected PUT behaviour.
Because ObjectId can't be calculated beforehand, the URL string will contain only ContainerID string.
Object attributes should be taken from
X-Attribute-*headers. If there are known sources of information for other object headers, they also must be considered. For examplefilenameinContent-Dispositionheader has to be translated intoFilenameobject attribute.Note, that http header with underscores in names, used to distinguish well-known system attributes in NeoFS, are ignored by most of web servers because of FCGI/CGI variables naming conflicts. As a workaround, some special translation table must be used for HTTP.
Note, that HTTP header naming rules have differences with attribute naming rules in NeoFS. HTTP headers are case-insensitive and use ASCII range, according to RFC, but NeoFS attributes are case-sensitive and use any valid UTF-8 characters.
Example request:
PS: Originally posted by @realloc in https://github.com/nspcc-dev/neofs-http-gate/pull/14#issuecomment-772345689
After discussion, we decided to simplify attribute translation for now. Full translation requires support for UTF-8 values encoded according to RFC 8187/7230, this can be clarified and implemented in further PRs.
X-Attribute-NEOFS-prefixed headers considered well-known system attributes-translates to_X-Attribute-prefixed headers considered regular object attributes