[英]HTTP/2 connection error (PROTOCOL_ERROR): Request headers too long
I have a view that should be able to show large string values (~20k chars).我有一个应该能够显示大字符串值(~20k 个字符)的视图。
In the past this value was rendered as a textarea value in a razor *.cshtml page.在过去,此值在 razor *.cshtml 页面中呈现为 textarea 值。 But when I displayed the webpage in firefox, the browser was not loading the page.
但是当我在 firefox 中显示网页时,浏览器没有加载页面。 (Don't have got further error description here)
(这里没有进一步的错误描述)
I decided not to render the textarea value in the *.cshtml page anymore.我决定不再在 *.cshtml 页面中呈现 textarea 值。 Therefore I've added a script that loads the data via
$.get()
when the user clicks a button.因此,我添加了一个脚本,该脚本在用户单击按钮时通过
$.get()
加载数据。
But I'm still unable to deal with the large values..??但我仍然无法处理大值..?? Why is this?
为什么是这样? The large value is only treated on the server side - no transmission to the client!
大值仅在服务器端处理 - 不传输到客户端! Or am I wrong?
还是我错了?
I have turned now the log level (in appsettings.Development.json ) to debug .我现在将日志级别(在appsettings.Development.json中)转为debug 。
Now I get the following error:现在我收到以下错误:
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2ConnectionErrorException: HTTP/2 connection error (PROTOCOL_ERROR): Request headers too long.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.OnHeaderCore(Nullable`1 index, Boolean indexedValue, ReadOnlySpan`1 name, ReadOnlySpan`1 value)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.OnStaticIndexedHeader(Int32 index, ReadOnlySpan`1 value)
at System.Net.Http.HPack.HPackDecoder.ProcessHeaderValue(ReadOnlySpan`1 data, IHttpHeadersHandler handler)
at System.Net.Http.HPack.HPackDecoder.ParseHeaderValue(ReadOnlySpan`1 data, Int32& currentIndex, IHttpHeadersHandler handler)
at System.Net.Http.HPack.HPackDecoder.DecodeInternal(ReadOnlySpan`1 data, IHttpHeadersHandler handler)
at System.Net.Http.HPack.HPackDecoder.Decode(ReadOnlySequence`1& data, Boolean endHeaders, IHttpHeadersHandler handler)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.DecodeHeadersAsync(Boolean endHeaders, ReadOnlySequence`1& payload)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessContinuationFrameAsync(ReadOnlySequence`1& payload)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessFrameAsync[TContext](IHttpApplication`1 application, ReadOnlySequence`1& payload)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.Http2Connection.ProcessRequestsAsync[TContext](IHttpApplication`1 application)
I'm using now HttpContext.Session
instead of TempData
in my controller.我现在在我的
TempData
中使用HttpContext.Session
而不是 TempData。 That's it..而已..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.