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
Calling MakeRequestAsync with Stream content more then once results in error #1336
Labels
Milestone
Comments
Merged
@karb0f0s Can you make a repro project so I can look into it, please? |
Closed
Closed
@tuscen you might need to initialize a submodule first: |
Closed
Draft
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Calling
MakeRequestAsync
withStream
content more then once results in error.MakeRequestAsync
generates an HttpContent content each time it's called:Telegram.Bot/src/Telegram.Bot/TelegramBotClient.cs
Line 96 in 843756a
Some reqests contain
InputFileStream
content that forms a multi-part HttpContent withToMultipartFormDataContent
. Unerneath itStreamContent
adds to theMultipartFormDataContent
which rewindsStream
and next call tries to add content from the end of theStream
, resulting in empty content.Telegram.Bot/src/Telegram.Bot/Extensions/HttpContentExtensions.cs
Lines 24 to 31 in 843756a
The text was updated successfully, but these errors were encountered: