Skip to content

Conversation

@ladeak
Copy link
Contributor

@ladeak ladeak commented Aug 5, 2024

Sharing PathNormalizer Implementations

Sharing PathNormalizer Implementations between HttpSys and Kestrel servers

Description

  • Follow up PR on comment: Remove unsafe from PathNormalizer #56805 (comment)
  • Moving PathNormalizer from Shared\HttpSys to Shared\PathNormalizer (any other suggestions welcome), changing the namespace to Microsoft.AspNetCore.Internal
  • Sharing this file with HttpSys and Kestrel.Core
  • Remaining Kestrel specific code renamed to PathDecoder (open for suggestions)
  • Keeping the tests and benchmarks in Kestrel

Linked to #56534

@ghost ghost added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Aug 5, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Aug 5, 2024
@ladeak ladeak marked this pull request as draft August 5, 2024 20:37
- Follow up on comment: dotnet#56805 (comment)
- Moving PathNormalizer from Shared\HttpSys to Shared\PathNormalizer, changing the namespace to AspNetCore.Internal
- Shares the code between HttpSys and Kestrel.Core
- Remaining Kestrel specific code renamed to PathDecoder
- Keeping the tests and benchmarks in Kestrel
@ladeak ladeak force-pushed the ladeak-56534-merge-pathnormalizer branch from 8e0e0b8 to ca16213 Compare August 5, 2024 20:42
@ladeak ladeak marked this pull request as ready for review August 5, 2024 20:43
@BrennanConroy
Copy link
Member

Looks like you missed including the shared file in the httpsys csproj

Co-authored-by: Günther Foidl <gue@korporal.at>
@ladeak
Copy link
Contributor Author

ladeak commented Aug 6, 2024

Thank you @BrennanConroy I will follow up on that.

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

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

LGTM, but I'll wait for @BrennanConroy to take a look to merge.

<Compile Include="$(SharedSourceRoot)test\Shared.Tests\runtime\Http2\*.cs" LinkBase="Shared\runtime\Http2" />
<Compile Include="$(SharedSourceRoot)test\Shared.Tests\runtime\Http3\*.cs" LinkBase="Shared\runtime\Http3" />
<Compile Include="$(SharedSourceRoot)TestResources.cs" LinkBase="Shared" />
<Compile Include="$(SharedSourceRoot)test\Shared.Tests\PathNormalizerTests.cs" LinkBase="/" />
Copy link
Member

Choose a reason for hiding this comment

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

I think this is causing these tests to run again. They should already be running from the Shared.Tests.csproj.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. I wonder though how "discoverability" can be improved as the shared files are linked ie. in Kestrel.slnf but changing and finding corresponding unit tests are not that easy as the projects are not linked. Or is there a better slnf to edit.

ie. I did not notice this file exists until the failure in the CI, while I knew about the PathNormaizers.

@BrennanConroy BrennanConroy merged commit 71ddc60 into dotnet:main Aug 6, 2024
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-rc1 milestone Aug 6, 2024
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 community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants