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

Handle the case where appid contains at least one upperletter #1233

Merged
merged 7 commits into from
Feb 16, 2024

Conversation

TWEESTY
Copy link
Contributor

@TWEESTY TWEESTY commented Feb 9, 2024

Description

The .NET SDK Client for Dapr does not handle the case where the app id contains an upper character for HTPP service invocation, because it uses the property Host of the URI, which is case insensitive (always in lower case), inside the class InvocationHandler.

The change is to use the appid sent when creating the HTTPClient or if there is no appId, use the host issued by the original string of the URI to get the correct app id (i.e. case sensitive).

The DaprClient can always be used for another appid if the user put an absolute URI.

There is no breaking change.

Issue reference

#[#937]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • [ Not relevant] Extended the documentation

@TWEESTY TWEESTY requested review from a team as code owners February 9, 2024 16:16
@TWEESTY TWEESTY changed the title Handle the case where appid can contain some uppercases Handle the case where appid contains at least one upperletter Feb 9, 2024
@TWEESTY TWEESTY changed the title Handle the case where appid contains at least one upperletter [WIP] Handle the case where appid contains at least one upperletter Feb 9, 2024
@TWEESTY TWEESTY marked this pull request as draft February 9, 2024 19:39
@TWEESTY TWEESTY force-pushed the master branch 2 times, most recently from 07a75f3 to aa79f43 Compare February 9, 2024 20:26
@TWEESTY TWEESTY changed the title [WIP] Handle the case where appid contains at least one upperletter Handle the case where appid contains at least one upperletter Feb 9, 2024
@TWEESTY TWEESTY marked this pull request as ready for review February 9, 2024 20:27
@TWEESTY TWEESTY changed the title Handle the case where appid contains at least one upperletter [WIP] Handle the case where appid contains at least one upperletter Feb 10, 2024
@TWEESTY TWEESTY marked this pull request as draft February 10, 2024 06:32
@TWEESTY TWEESTY changed the title [WIP] Handle the case where appid contains at least one upperletter Handle the case where appid contains at least one upperletter Feb 10, 2024
@TWEESTY TWEESTY marked this pull request as ready for review February 10, 2024 19:52
Signed-off-by: Nicolas Chaussé <[email protected]>
Signed-off-by: TWEESTY <[email protected]>
Signed-off-by: Nicolas Chaussé <[email protected]>
Signed-off-by: Nicolas Chaussé <[email protected]>
Signed-off-by: TWEESTY <[email protected]>
Signed-off-by: Nicolas Chaussé <[email protected]>
…use case

Signed-off-by: TWEESTY <[email protected]>
Signed-off-by: Nicolas Chaussé <[email protected]>
Signed-off-by: TWEESTY <[email protected]>
Signed-off-by: Nicolas Chaussé <[email protected]>
Signed-off-by: TWEESTY <[email protected]>
Signed-off-by: Nicolas Chaussé <[email protected]>
Copy link
Collaborator

@philliphoff philliphoff left a comment

Choose a reason for hiding this comment

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

I'd prefer to avoid the URL parsing if the principal scenario is unblocked without it.

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ca2fab2) 67.17% compared to head (cfa1bb2) 67.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1233      +/-   ##
==========================================
+ Coverage   67.17%   67.20%   +0.02%     
==========================================
  Files         174      174              
  Lines        5986     5991       +5     
  Branches      667      668       +1     
==========================================
+ Hits         4021     4026       +5     
  Misses       1798     1798              
  Partials      167      167              
Flag Coverage Δ
net6 67.17% <100.00%> (+0.02%) ⬆️
net7 67.17% <100.00%> (+0.02%) ⬆️
net8 67.18% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Nicolas Chaussé <[email protected]>
@TWEESTY
Copy link
Contributor Author

TWEESTY commented Feb 16, 2024

I'd prefer to avoid the URL parsing if the principal scenario is unblocked without it.

Alright I've updated the code in this way?

@philliphoff philliphoff merged commit 817b60d into dapr:master Feb 16, 2024
12 checks passed
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.

2 participants