File tree 2 files changed +16
-0
lines changed
azure/core/pipeline/transport
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 9
9
### Bugs Fixed
10
10
11
11
- respect text encoding specified in argument (thanks to @ryohji for the contribution) #20796
12
+ - fix adding unnecessary joiners between URLs during ` format_url ` #21314
12
13
13
14
### Other Changes
14
15
Original file line number Diff line number Diff line change @@ -112,6 +112,21 @@ def _format_url_section(template, **kwargs):
112
112
113
113
def _strip_and_combine_url_sections (base_section , stub_section , join_symbol ):
114
114
# 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
+ """
115
130
stripped_base = base_section .rstrip (join_symbol )
116
131
stripped_stub = stub_section .lstrip (join_symbol )
117
132
joiner = ""
You can’t perform that action at this time.
0 commit comments