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

Fix UriHelper length calculation when path is empty #32364

Merged
merged 1 commit into from
May 3, 2021

Conversation

MihaZupan
Copy link
Member

#29448 regressed the pathBase ends with a slash && path is empty case in UriHelper.

UriHelper.BuildAbsolute("http", new HostString("example.com"), pathBase: "/", path: "");

It would end up substracting 1 from the length even if the path was empty.
The operation throws as the allocated string is too short.

@MihaZupan MihaZupan requested review from paulomorgado and Tratcher May 3, 2021 19:15
@MihaZupan MihaZupan requested a review from jkotalik as a code owner May 3, 2021 19:15
@ghost ghost added the area-runtime label May 3, 2021
@BrennanConroy BrennanConroy added the bug This issue describes a behavior which is not expected - a bug. label May 3, 2021
@Tratcher Tratcher added this to the 6.0-preview5 milestone May 3, 2021
@Tratcher Tratcher enabled auto-merge (squash) May 3, 2021 21:49
@Tratcher
Copy link
Member

Tratcher commented May 3, 2021

Thanks for fixing the root issue.

@Tratcher Tratcher merged commit aee816f into dotnet:main May 3, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions bug This issue describes a behavior which is not expected - a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants