Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZERO_LENGTH RANGE status code #276

Open
carpawell opened this issue Sep 25, 2023 · 5 comments
Open

ZERO_LENGTH RANGE status code #276

carpawell opened this issue Sep 25, 2023 · 5 comments
Labels
I3 Minimal impact question Further information is requested S3 Minimally significant U4 Nothing urgent

Comments

@carpawell
Copy link
Member

carpawell commented Sep 25, 2023

We have OUT_OF_RANGE status code but if a request is with a zero-length, we return a general error cause that is not OUT_OF_RANGE in fact (but on our CLI, SDK, and SN levels it is prohibited).

Do we need some ZERO_LENGTH response code? Note: the current API does not say it MUST be prohibited.

@carpawell carpawell added question Further information is requested triage labels Sep 25, 2023
@carpawell carpawell changed the title ZERO_LENGTH RANGE requests ZERO_LENGTH RANGE requests Sep 25, 2023
@carpawell carpawell changed the title ZERO_LENGTH RANGE requests ZERO_LENGTH RANGE status code Sep 25, 2023
@roman-khimov
Copy link
Member

OUT_OF_RANGE doesn't seem to be far off for this.

@carpawell
Copy link
Member Author

So you mean using OUT_OF_RANGE for zero-length? We do not do it now.

@roman-khimov
Copy link
Member

Yeah, it should be good enough. @cthulhu-rider?

@cthulhu-rider
Copy link
Contributor

it's documented like this, so, according to them, we may respond with this status on any invalid range

at the same time, for example, gRPC says that Unlike INVALID_ARGUMENT...
(imagine #269) this error indicates a problem that may be fixed if the system state changes

in total, i vote for BAD_REQUEST cuz it more like it's nonsense in all cases while OUT_OF_RANGE is more about object exists (!) but u are out of its range (technically we may respond to [0,0] range with empty data)

P.S. zero RANGE request is the only way to check object existence w/o any object data transmission, feature huh? i don't think so, use HEAD instead

@carpawell
Copy link
Member Author

Agree that OUT_OF_RANGE is more like an incorrect range (does not fit an object) while [X:0] is about a senseless range.

@roman-khimov roman-khimov added U4 Nothing urgent S3 Minimally significant I3 Minimal impact and removed triage labels Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I3 Minimal impact question Further information is requested S3 Minimally significant U4 Nothing urgent
Projects
None yet
Development

No branches or pull requests

3 participants