超出了内部响应标头的大小限制 [英] An internal response header size limit was exceeded

查看:363
本文介绍了超出了内部响应标头的大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行重定向到相关网站的另一部分时,会发生此错误.

This error occurrs when I perform a redirect to another part of the site in question.

return this.RedirectToActionPermanent("Index", "Dashboard"

在错误发生之前,代码不会进入Dashboard控制器中的Index方法.

The code does not step into the Index method in the Dashboard controller before the error occurs.

我认为发布的Fiddler响应标头不是> internal<错误消息中的响应头.

I think the Fiddler response header posted is not the >internal< Response header in the error message.

任何人都可以解释如何最好地增加内部响应标头的大小限制吗?

Could anyone explain how best to increase the size limit of the internal response header?

或者,我们是否正在考虑压缩内部响应标头作为解决方案?

Or, Are we looking at needing to compress the internal response header as a solution?

为您提供信息,重定向到上面的呼叫每天工作大约3个月,直到大约5天前中断.

For your information the call to redirect above was working day in day out for about 3 months until it broke about 5 days ago.

program.cs文件现在看起来像:

The program.cs file is now looking like:

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().ConfigureKestrel((context, options) => {
            options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(5);
            options.Limits.MaxResponseBufferSize = 1024000;
            options.Limits.Http2.HeaderTableSize = 16384;
        });

但是,同样的错误仍在发生.

However, the same error is still occurring.

该问题是由于未在其中一个概要文件用户的(身份表)中填写用户声明引起的.我在SSMS中手动填写了数据,并且错误停止了发生.

The problem was caused by a User Claim not being filled in (Identity Table) on one of the profile users. I filled the data in manually in SSMS and the error stopped occurring.

TIA.

大卫

推荐答案

我也遇到了类似的问题 这是由WinHTTP中的一个错误引起的,该错误发生在很久以前(核心2.0版).当发生重定向响应时,WinHTTP倾向于重用相同的连接来跟随重定向. 耗尽的响应字节数由WinHttpHandler.MaxResponseDrainSize控制. 当响应大小超过MaxResponseDrainSize时,请求将中止,并显示指定的错误.

I have also faced similar issue, for me this was caused by a bug in WinHTTP which happened long time ago (core 2.0). When a redirect response occurs, WinHTTP prefers to reuse the same connection to follow the redirect. The number of response bytes drained is controlled by the WinHttpHandler.MaxResponseDrainSize. When the response size exceeds MaxResponseDrainSize the request is aborted with specified error.

当我升级到2.1时,问题消失了

The issue disappeared when i upgraded to 2.1

  • 更新淘汰问题

您添加为KeepAliveTimeout = TimeSpan.FromMinutes(5)的设置;适用于Kestrel,但不适用于IIS. 在IIS和Kestrel之间有一个反向代理设置.因此,您将Kestrel的超时时间设置为5分钟.但是IIS的默认超时时间为120秒.您可以更改超时时间 IIS->站点->选择您的站点->高级设置->限制->连接超时 . 尝试更改此设置以检查是否发生此错误.

The settings you add as KeepAliveTimeout = TimeSpan.FromMinutes(5); applies to Kestrel but not IIS. There is a reverse proxy setup between IIS and Kestrel. So you made the Timeout of Kestrel to 5 Min. But IIS sits with default timeout which is 120sec. You can change the time out in IIS->Sites->Select your Site->Advanced Settings ->Limits->Connection Time Out. Try changing this settings to check whether this error happens.

配置编辑器中还有另一个可用设置

Also there is another setting available in Configuration Editor

这篇关于超出了内部响应标头的大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆