Skip to content

Commit ba45509

Browse files
committed
Fix edge case with relative SMP URLs
1 parent ff385f2 commit ba45509

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/peppol_py/smp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ def get_smp_url_from_dns(participant_id, test_environment):
4747

4848
# SMP: domain + path -> xml with service descriptions
4949
# get all available interfaces (invoice, credit note etc.)
50+
if not result.endswith("/"):
51+
# If the record resolves as "https://example.com/smp", we need to go to "https://smp.service.afasonline.com/smp/iso…",
52+
# not "https://smp.service.afasonline.com/isoo…
53+
result += "/"
5054
return urllib.parse.urljoin(result, "./iso6523-actorid-upis::" + participant_id)
5155

5256

0 commit comments

Comments
 (0)