JoinPaths: don't add "/" before the query string#19278
JoinPaths: don't add "/" before the query string#19278jhendrixMSFT merged 3 commits intoAzure:mainfrom
Conversation
|
Thank you for your contribution drakkan! We will review the pull request and get back to you soon. |
|
When you fix the broken test can you please also add an entry to the changelog? |
done. I think it is ok to omit the slash before a query string. The url is valid and this change fixes the linked issue |
|
Maybe we should always remove the trailing slash, something like this: what do you think about? Thanks |
|
I was thinking about |
you get Refactored the to use |
|
I was discussing this with @chlowell and he brought up a good point that |
|
|
That's what Charles and I were discussing. Probably best that |
|
Hmm this might be problematic in some cases. E.g. when obtaining a SAS URL for a storage service account via the portal, there will be a trailing
Preserving the So, while I still think that having |
what do you think about something like this? the trailing slash is preserved if provided in the last path element. This should be quite unopinionated. Also note that I don't care about the authorship of the patch. I just want the original issue fixed. If you think you can fix the problem on your own faster then go for it and close this PR. Thanks |
…y string Preserve a trailing slash if the last path element has it Fixes Azure#19245
also fix container.GetSASURL
|
@jhendrixMSFT thanks! I did a quick test and I confirm the merged patch fix the reported issue. I also wrote a small benchmark comparing the string builder approach with the used string concatenation here the results: performance is OK even with the current approach, we can optimize the code in the future, thanks |
|
Thanks for the analysis. I more or less copied this from Agreed there's future optimization work (and not just in this func). |
I agree, v0.5.0 is a big step forward in usability over previous versions and |
Fixes #19245