Skip to content
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

Check for Content-Length in response headers #15

billbogaiv opened this issue Sep 20, 2016 · 1 comment

Check for Content-Length in response headers #15

billbogaiv opened this issue Sep 20, 2016 · 1 comment


Copy link

@billbogaiv billbogaiv commented Sep 20, 2016

Note: This may or may not be specific to ASP.NET Core.

Currently, if middleware upstream sets the Content-Length header (i.e. StaticFiles), then usage of WebMarkupMin results in a 200, but no content. This is because the resulting content-size is no longer the same as reported by the header-value. My current resolution is to insert my own middleware to remove the header:


app.Use(async (context, next) =>
    await next();

    if (context.Response.Headers.ContainsKey("Content-Length"))


A bit more info. is posted here.

Copy link

@Taritsyn Taritsyn commented Sep 27, 2016

Hello, Bill!

In WebMarkupMin 2.2.0 fixed this error.

Thanks for information! Instead of removing the Content-Length HTTP header, I change its value.

@Taritsyn Taritsyn closed this Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants