簡體   English   中英

HTTP/2 連接錯誤 (PROTOCOL_ERROR):請求標頭太長

[英]HTTP/2 connection error (PROTOCOL_ERROR): Request headers too long

我有一個應該能夠顯示大字符串值(~20k 個字符)的視圖。

在過去,此值在 razor *.cshtml 頁面中呈現為 textarea 值。 但是當我在 firefox 中顯示網頁時,瀏覽器沒有加載頁面。 (這里沒有進一步的錯誤描述)

我決定不再在 *.cshtml 頁面中呈現 textarea 值。 因此,我添加了一個腳本,該腳本在用戶單擊按鈕時通過$.get()加載數據。

但我仍然無法處理大值..?? 為什么是這樣? 大值僅在服務器端處理 - 不傳輸到客戶端! 還是我錯了?

我現在將日志級別(在appsettings.Development.json中)轉為debug

現在我收到以下錯誤:

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)

我現在在我的TempData中使用HttpContext.Session而不是 TempData。 而已..

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM