ResponseStreamWrapper.Write, which internally calls the async method InjectLiveReloadScriptAsync, never waits for it to complete and so could lead to corruption of sorts. This PR fixes that by blocking until the asynchronous operation completes.
I seriously doubted if ASP.NET Core ever calls the synchronous methods a Stream so this bug may never show up but I noticed the issue on passing and thought why take the risk of having it wrong?
ResponseStreamWrapper.Write
, which internally calls the async methodInjectLiveReloadScriptAsync
, never waits for it to complete and so could lead to corruption of sorts. This PR fixes that by blocking until the asynchronous operation completes.I seriously doubted if ASP.NET Core ever calls the synchronous methods a
Stream
so this bug may never show up but I noticed the issue on passing and thought why take the risk of having it wrong?