Opened at 2022-07-05T20:12:40Z
Closed at 2022-07-22T16:37:21Z
#3907 closed defect (fixed)
HTTP storage protocol should not support requests beyond the end of the share
Reported by: | itamarst | Owned by: | GitHub <noreply@…> |
---|---|---|---|
Priority: | normal | Milestone: | HTTP Storage Protocol |
Component: | unknown | Version: | n/a |
Keywords: | Cc: | ||
Launchpad Bug: |
Description
Currently requests beyond the end of the share result in truncated result. This is a weird thing to do from an HTTP perspective, and I suspect is only done because Foolscap maps directly to function calls; more structured information in a HTTP response ought to make it unnecessary. So:
- The HTTP protocol will not support this; reading beyond the end will result in HTTP error.
- The HTTP protocol will grow HEAD endpoints for mutable and immutables shares to get their length.
- Given the length of a share, the IStorageServer emulation layer can emulate this behavior by truncating requests to the actual length of the share. If a mutable is written half-way this in theory can result in error, but oh well.
Change History (3)
comment:1 Changed at 2022-07-18T16:42:42Z by itamarst
comment:2 Changed at 2022-07-18T17:09:19Z by itamarst
- Address all TODOs mentioning 3907, using new proposed design where truncated responses are acceptable so long as they are internally consistent.
- The client should validate the length of response matches what is claimed in the Content-Range header. If it doesn't, this is either a bug, or in the case of mutables suggests a write happened while reading. Either way the data should be thrown away.
comment:3 Changed at 2022-07-22T16:37:21Z by GitHub <noreply@…>
- Owner set to GitHub <noreply@…>
- Resolution set to fixed
- Status changed from new to closed
In 26f15f4/trunk:
Note: See
TracTickets for help on using
tickets.
After further thought, returning truncated responses is probably fine. However, we still need to ensure the response headers are correct, which is _not_ the case now.