Skip to content

[Infrastructure] Update SDK version #42571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "7.0.100-preview.7.22327.3"
"version": "7.0.100-preview.7.22357.3"
},
"tools": {
"dotnet": "7.0.100-preview.7.22327.3",
"dotnet": "7.0.100-preview.7.22357.3",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Expand Down
5 changes: 3 additions & 2 deletions src/Servers/Kestrel/Core/src/Internal/Http/HttpParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,16 @@ private int ParseMultiSpanHeader(TRequestHandler handler, ref SequenceReader<byt
}

SequencePosition lineEnd;
ReadOnlySpan<byte> headerSpan;
scoped ReadOnlySpan<byte> headerSpan;
if (currentSlice.Slice(reader.Position, lineEndPosition.Value).Length == currentSlice.Length - 1)
{
// No enough data, so CRLF can't currently be there.
// However, we need to check the found char is CR and not LF

// Advance 1 to include CR/LF in lineEnd
lineEnd = currentSlice.GetPosition(1, lineEndPosition.Value);
headerSpan = currentSlice.Slice(reader.Position, lineEnd).ToSpan();
var header = currentSlice.Slice(reader.Position, lineEnd);
headerSpan = header.IsSingleSegment ? header.FirstSpan : header.ToArray();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @Tratcher @halter73 the new SDK version was complaining about span errors, I think related to the new compiler changes. I am not sure if there is something we can do in the ToSpan() extension method to address it, so I inlined the implementation here instead.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrennanConroy Yep, I was seeing the errors in the other PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't sure if I wasn't getting the concept/syntax right

if (headerSpan[^1] != ByteCR)
{
RejectRequestHeader(headerSpan);
Expand Down