-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
use IRemoteContentStream without form content headers #9180
use IRemoteContentStream without form content headers #9180
Conversation
alexandru-bagu
commented
May 28, 2021
- allow the usage of IRemoteContentStream or RemoteContentStream when the incoming stream is not a form content format
- remove all rewinds related to streams; the user is the one who must ensure his streams are at the correct position when calling the api; stream rewind would exclude the ability of sending partial streams (at least skippable streams, because the tail cannot be limitted in .net core)
- RemoteStreamContent now must get the content type associated with the stream in its constructor; it may also receive the length of the stream in a read-only form (this is because some stream classes cannot provide the length and it is provided via http headers)
- IRemoteStreamContent should implement IDisposable to allow the auto clean up of streams (example: FileStream)
…n the incoming stream is not a form content format 2. remove all rewinds related to streams; the user is the one who must ensure his streams are at the correct position when calling the api; stream rewind would exclude the ability of sending partial streams (at least skippable streams, because the tail cannot be limitted in .net core) 3. RemoteStreamContent now must get the content type associated with the stream in its constructor; it may also receive the length of the stream in a read-only form (this is because some stream classes cannot provide the length and it is provided via http headers) 4. IRemoteStreamContent should implement IDisposable to allow the auto clean up of streams (example: FileStream)
The abp/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/RequestPayloadBuilder.cs Line 71 in 821c089
|
I am not sure why GenerateBody would have to be changed. At the moment if you receive a request with a content-type different than some type of form then it would be processed as a IRemoteContentStream or RemoteContentStream. If in turn this would have to be then proxied to the application layer, the GenerateBody you are referring to would then encode it within a FormFile which would be fine as the application layer would then read the proper content-type from inside the form file content headers. From a JS point of view I guess there's no way to easily send a file or a stream. But this is mostly a change for backend api calls not necessarily for frontend. Is this what you are talking about or something else? |