Skip to content

Commit 8ef37c5

Browse files
committed
PR feedback
1 parent 84b4430 commit 8ef37c5

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/Servers/Kestrel/Core/src/Internal/Http2/HPackHeaderWriter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ private static bool IsSensitive(int staticTableIndex, string name)
154154
switch (staticTableIndex)
155155
{
156156
case H2StaticTable.SetCookie:
157-
return true;
158157
case H2StaticTable.ContentDisposition:
159158
return true;
160159
case -1:

src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,33 +1226,30 @@ private void UpdateConnectionState()
12261226
}
12271227
}
12281228

1229-
// We can't throw a Http2StreamErrorException here, it interrupts the header decompression state and may corrupt subsequent header frames on other streams.
1230-
// For now these either need to be connection errors or BadRequests. If we want to downgrade any of them to stream errors later then we need to
1231-
// rework the flow so that the remaining headers are drained and the decompression state is maintained.
12321229
public void OnHeader(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
12331230
{
1234-
OnHeaderCore(index: null, indexOnly : false, name, value);
1231+
OnHeaderCore(index: null, indexedValue: false, name, value);
12351232
}
12361233

12371234
public void OnStaticIndexedHeader(int index)
12381235
{
12391236
Debug.Assert(index <= H2StaticTable.Count);
12401237

12411238
ref readonly var entry = ref H2StaticTable.Get(index - 1);
1242-
OnHeaderCore(index, indexOnly: true, entry.Name, entry.Value);
1239+
OnHeaderCore(index, indexedValue: true, entry.Name, entry.Value);
12431240
}
12441241

12451242
public void OnStaticIndexedHeader(int index, ReadOnlySpan<byte> value)
12461243
{
12471244
Debug.Assert(index <= H2StaticTable.Count);
12481245

1249-
OnHeaderCore(index, indexOnly: false, H2StaticTable.Get(index - 1).Name, value);
1246+
OnHeaderCore(index, indexedValue: false, H2StaticTable.Get(index - 1).Name, value);
12501247
}
12511248

12521249
// We can't throw a Http2StreamErrorException here, it interrupts the header decompression state and may corrupt subsequent header frames on other streams.
12531250
// For now these either need to be connection errors or BadRequests. If we want to downgrade any of them to stream errors later then we need to
12541251
// rework the flow so that the remaining headers are drained and the decompression state is maintained.
1255-
private void OnHeaderCore(int? index, bool indexOnly, ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
1252+
private void OnHeaderCore(int? index, bool indexedValue, ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
12561253
{
12571254
// https://tools.ietf.org/html/rfc7540#section-6.5.2
12581255
// "The value is based on the uncompressed size of header fields, including the length of the name and value in octets plus an overhead of 32 octets for each header field.";
@@ -1283,7 +1280,7 @@ private void OnHeaderCore(int? index, bool indexOnly, ReadOnlySpan<byte> name, R
12831280
// Throws InvalidOperation for bad encoding.
12841281
if (index != null)
12851282
{
1286-
_currentHeadersStream.OnHeader(index.Value, indexOnly, name, value);
1283+
_currentHeadersStream.OnHeader(index.Value, indexedValue, name, value);
12871284
}
12881285
else
12891286
{

src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,13 @@ private enum StreamCompletionFlags
625625
Aborted = 4,
626626
}
627627

628-
public override void OnHeader(int index, bool indexOnly, ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
628+
public override void OnHeader(int index, bool indexedValue, ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
629629
{
630-
base.OnHeader(index, indexOnly, name, value);
630+
base.OnHeader(index, indexedValue, name, value);
631631

632-
if (indexOnly)
632+
if (indexedValue)
633633
{
634-
// Special case setting index only headers for performance
634+
// Special case setting headers when the value is indexed for performance.
635635
switch (index)
636636
{
637637
case H2StaticTable.MethodGet:

0 commit comments

Comments
 (0)