Skip to content

Check for Content-Length in response headers #15

Closed

Description

@billbogaiv

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.UseWebMarkupMin();

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

    if (context.Response.Headers.ContainsKey("Content-Length"))
    {
        context.Response.Headers.Remove("Content-Length");
    }
});

app.UseStaticFiles();

A bit more info. is posted here.

Activity

  1. added a commit that references this issue on Sep 26, 2016
  2. Taritsyn commented on Sep 27, 2016

    @Taritsyn
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions