Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ public bool TryParseMessage(in ReadOnlySequence<byte> input, ref SequencePositio
return false;
}

//First char must be / for relative URI
if (path[0] == (byte)'/')

Choose a reason for hiding this comment

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

I know this is old. But @adamradocz , won't the compiler just have this as a literal? No need to cache something that isn't an instance, right?

Choose a reason for hiding this comment

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

Also, @nickbreese, couldn't a relative URIL start with a .? So, like "./Blah"? Or, it could even be "images/image1.jpg"? If any of these are true, this will not work.

Copy link
Contributor

Choose a reason for hiding this comment

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

@smeddows, yes, you're right.

Choose a reason for hiding this comment

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

@smeddows, yes, you're right.

Which part? :)

{
_httpRequestMessage.RequestUri = new Uri(Encoding.ASCII.GetString(path), UriKind.Relative);
}
else
{
_httpRequestMessage.RequestUri = new Uri(Encoding.ASCII.GetString(path));
}
_httpRequestMessage.Method = new HttpMethod(Encoding.ASCII.GetString(method));
_httpRequestMessage.RequestUri = new Uri(Encoding.ASCII.GetString(path), UriKind.Relative);
_httpRequestMessage.Version = new Version(1, 1);
// Version = Encoding.ASCII.GetString(version.IsSingleSegment ? version.FirstSpan : version.ToArray());

Expand Down