Wrong URL in HTTP channel on Windows

24 views
Skip to first unread message

alessan...@gmail.com

unread,
Oct 26, 2022, 12:50:46 PM10/26/22
to Bots Open Source EDI Translator
Hello,
When installed on a Windows host and using a channel with http communication, bots generates incorrect URLs. These URLs have backslashes in some of the places where forward slashes are meant to be. The presence of these backslashes is caused by the use of os.path.join in botslib.Uri, which joins URI components with a platform-specific separator. Since the Uri class is only used for HTTP, I propose it be modified to always use the posixpath.join function, which joins components with forward slashes regardless of platform. I'm attaching a patch containing the proposed change.

Unless and until the patch is applied to the official release, this error can be circumvented with a carefully crafted path string that takes advantage of os.path.join.
If, for example, one needs to POST to
This can be achieved by leaving the host and port portions empty and filling path with
//localhost:3000/entity/
Although this is essentially a hack and far from the optimal solution.

Cheers,
Alesssandro Rubino
windows_http.patch

Eppye Bots

unread,
Oct 26, 2022, 12:56:14 PM10/26/22
to bots...@googlegroups.com
yes, indeed! big mistake.

kind regards, Henk-Jan Ebbers


--
You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/botsmail/8c2ad36f-3e76-4c56-96f7-370b2e9c43den%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages