Skip to content

Commit 92d8485

Browse files
committed
add changelog and comments
1 parent 075ac7f commit 92d8485

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

sdk/core/azure-core/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Bugs Fixed
1010

1111
- respect text encoding specified in argument (thanks to @ryohji for the contribution) #20796
12+
- fix adding unnecessary joiners between URLs during `format_url` #21314
1213

1314
### Other Changes
1415

sdk/core/azure-core/azure/core/pipeline/transport/_base.py

+15
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ def _format_url_section(template, **kwargs):
112112

113113
def _strip_and_combine_url_sections(base_section, stub_section, join_symbol):
114114
# type: (str, str, str) -> str
115+
"""Strip and combine base and stub URL sections.
116+
117+
We only join the base and the stub section together with the join symbol if
118+
(a) the base section ends with the join symbol or the stub section starts with
119+
that symbol
120+
OR
121+
(b) the base and the stub section are both non-empty strings
122+
123+
:param str base_section: The section of the base URL we are going to join
124+
:param str stub_section: The section of the stub URL we are going to join
125+
:param str join_symbol: The symbol we will join them with, if we fulfil criteria
126+
a and b.
127+
:returns: The joined sections
128+
:rtype: str
129+
"""
115130
stripped_base = base_section.rstrip(join_symbol)
116131
stripped_stub = stub_section.lstrip(join_symbol)
117132
joiner = ""

0 commit comments

Comments
 (0)