OWIN OnSendingHeaders Callback - Reading Response Body

前端 未结 1 1272
南笙
南笙 2021-01-28 19:29

This question is related to the excellent answer by Youssef. I love OnSendingHeaders callback. I can now add the response headers without worrying about switching s

相关标签:
1条回答
  • 2021-01-28 19:55

    What do you want to do with the response body?

    This callback is invoked on first write, so it's too late to replace the stream. You also can't read from the response stream as there is nothing stored in it normally. This is normally a write-only stream that goes out to the network.

    Replacing the response stream earlier is the correct approach here.

    0 讨论(0)
提交回复
热议问题