Headers are read-only, response has already started

See original GitHub issue

Hi, When debug lara in aspnetcore web project I have the next fail : Headers are read-only, response has already started

trace in the file MiddlewareCommon.cs function

public static async Task WriteBuffer(HttpContext http, byte[] buffer)
        {
            try
            {
                await http.Response.Body.WriteAsync(buffer.AsMemory(0, buffer.Length));
                http.Response.ContentLength = buffer.Length;
            }
            catch (Exception ex)
            {
                throw;   //here put break point
            }
        }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rChavzcommented, Dec 10, 2020

the message error occurs when debug in netcore app, when run in IISExpress does not appear

0reactions
pablocar80commented, Dec 11, 2020

the latest version published on nuget fixes this issue, thank you very much for reporting it @rChavz

Read more comments on GitHub >

github_iconTop Results From Across the Web

Headers are read only exception when writing to ...
I understand you cannot set the headers once data is written to the response, but on my end I am setting the headers...
Read more >
Exception "Headers are read-only, response has already ...
Whenever the access token is refreshed, I get an exception "Headers are read-only, response has already started" There is nothing special ...
Read more >
Use HttpContext in ASP.NET Core
InvalidOperationException: Headers are read-only, response has already started. Write response body. An HTTP response can include a response ...
Read more >
Add Headers To A Response In ASP.NET 5
Learn to add any HTTP header to an ASP.NET response. ... InvalidOperationException: Headers are read-only, response has already started.
Read more >
Web Report Designer Error Headers are read-only, response ...
Web Report Designer Error Headers are read-only, response has already started. Hi, after Updating to the latest version I'm getting this error:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found