Skip to content
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

Check URI is relative before processing as relative #154

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nickbreese
Copy link

Http1RequestMessageReader makes an assumption that the path provided is a relative path when constructing a Uri(). This causes an exception when parsing a CONNECT message, and presumably when the path is fully qualified.

@nickbreese nickbreese force-pushed the nickbreese/fix-relative-uri branch from f316838 to 2dea84d Compare July 16, 2022 02:55
@@ -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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants