Skip to content

Commit caa195b

Browse files
authored
Fix post request for url with long time date list (#56)
* Fixed parse_url_for_post_data() * Fixed parse_url_for_post_data(), solution 2 * Reformat and correction
1 parent e94f04f commit caa195b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

meteomatics/parsing_util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,13 @@ def parse_url_for_post_data(url):
334334
"""Split the url between url and data if needed"""
335335
url_splitted = url.split("/", 4)
336336
data = None
337+
max_length_url = 2000
337338
if len(url_splitted) > 4:
338339
url = "/".join(url_splitted[0:4])
339340
data = url_splitted[4]
341+
if len(url) > max_length_url:
342+
url = "/".join(url_splitted[0:3])
343+
data = "/".join(url_splitted[3:])
340344
return url, data
341345

342346

0 commit comments

Comments
 (0)