-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Webdav Get 0 bytes - stream already consumed by loggingresponse #73
Comments
The preferred (easiest) solution would be to add a |
That wont work though. |
A couple of idea's: The loggingwebdavresponse will always consume the body since the ContentType is hardcoded so the We could check the type of result (in the WebDavIndirectResult.ExecuteResult) and omit the entire loggingwebdavresponse? In LoggingWebDavResponse, don't load XDocument for http GET, unsure about this one. Might return file data as well as xml in webdav. Not familiar enough with the standard or the lib. Provide the loggingsresponse's buffered output to the WebDavFullDocumentResult, |
The last option seems like it would be the best solution. |
PR available. #74 |
We found an issue that emerged in our test/QA-environment where if debug-logging is activated a WebDav GET request would return 0 bytes.
Traced this (after many a wild goose chases :)) to the behaviour of the WebDavIndirectResult.cs (in branch release/2.0 which we're using).
The above code causes the document stream to be consumed twice, first in the LoggingWebDavResponse and then in the await _result.ExeCuteResultAsync(...) at the bottom.
Second time the stream is already consumed causing the stream.CopyToAsync(body) to write 0 bytes.
I'd be happy to put up a PR but there are multiple ways this issue can be alleviated so I would need your input on the preferred way.
The text was updated successfully, but these errors were encountered: