-
Notifications
You must be signed in to change notification settings - Fork 220
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
Questions about streaming and Content-Length
#1086
Comments
This particular test targets a blob that has the I agree the name could be misleading. Would you be able to send a PR to change the name? Also feel free to make the content-length check more specific rather than a presence check if you like. |
Ah, I completely missed Four follow-up questions. With
The spec is worded with MUST,
so I'd expect the answers to all 4 questions would be "Yes", but it'd be nice if the spec explicitly called out these cases. I also think "Yes" to all 4 questions might be too harsh of a requirement. I always associate the usefulness of streaming with being able to stream from file descriptors, where it's very hard in most cases to know the size of the stream in advance without buffering the entire thing into memory. I can only foresee |
My understanding is that for the more general case where length won't be known in advance and the server is ok to support that case, the model just won't have |
Re: your follow ups - Yeah I think 1 and 2 is Yes. 4 also is Yes - why allow a service to not send Content-Length when it has modeled it as |
I think the remaining follow up on this issue is to looking at making |
I think so. I've changed my mind on this over the years. If the client tries to resolve this, it's potentially making big assumptions that the stream is repeatable or can be buffered to disk. Callers trying to send an unbounded stream will need to do this work themselves, and they're the only ones in the position to make the decision as to how they'll provide the length.
Yes
No to both. This should only be honored on requests. Sending a PR now. |
We have no use case of a server needing to be constrained by requiresLength. We can always expand this trait later if needed since it's an annotation trait. Closes #1086
We have no use case of a server needing to be constrained by requiresLength. We can always expand this trait later if needed since it's an annotation trait. Closes #1086
What should
Content-Length
be set to for streaming operations in the different AWS protocols?The restJson1 spec does not prescribe anything. However, the protocol test suite contains this test:
Under what circumstances should streaming operations include the
Content-Length
header?Here it's clear it should be set to 16 (which by the way, the test does not assert, it only asserts the presence of the header, why?), but for an arbitrary stream the client / server might not know in advance the size of the payload. I therefore think a better name for this test would be something like
RestJsonStreamingTraitsRequireLengthWithBlobOfKnownSize
(unless of course the header should always be set in restJson1, in which case I'd like to know what value it should be set to if the stream's size is not known in advance).The text was updated successfully, but these errors were encountered: