Skip to content

Fix UriHelper length calculation when path is empty#32364

Merged
Tratcher merged 1 commit into
dotnet:mainfrom
MihaZupan:uri-helper
May 3, 2021
Merged

Fix UriHelper length calculation when path is empty#32364
Tratcher merged 1 commit into
dotnet:mainfrom
MihaZupan:uri-helper

Conversation

@MihaZupan
Copy link
Copy Markdown
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 Tratcher and paulomorgado 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
Copy Markdown
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