@@ -132,7 +132,7 @@ def get_url_base(
132
132
stream_slice = stream_slice ,
133
133
next_page_token = next_page_token ,
134
134
)
135
- return os . path . join (self ._url_base .eval (self .config , ** interpolation_context ), EmptyString )
135
+ return str (self ._url_base .eval (self .config , ** interpolation_context ))
136
136
137
137
def get_path (
138
138
self ,
@@ -370,13 +370,18 @@ def _join_url(cls, url_base: str, path: str) -> str:
370
370
Example:
371
371
1) _join_url("https://example.com/api/", "endpoint") >> 'https://example.com/api/endpoint'
372
372
2) _join_url("https://example.com/api", "/endpoint") >> 'https://example.com/api/endpoint'
373
- 3) _join_url("https://example.com/api/", "") >> 'https://example.com/api'
373
+ 3) _join_url("https://example.com/api/", "") >> 'https://example.com/api/ '
374
374
4) _join_url("https://example.com/api", None) >> 'https://example.com/api'
375
375
"""
376
376
377
377
# return a full-url if provided directly from interpolation context
378
378
if path == EmptyString or path is None :
379
- return url_base .rstrip ("/" )
379
+ return url_base
380
+ else :
381
+ # since we didn't provide a full-url, the url_base might not have a trailing slash
382
+ # so we join the url_base and path correctly
383
+ if not url_base .endswith ("/" ):
384
+ url_base += "/"
380
385
381
386
return urljoin (url_base , path )
382
387
0 commit comments