<i>Bug in library http. Illegal characters in path</i> status still Open with 3 other changes
by
.
D 2018-04-13T15:08:54.918
J icomment There\sare\scorner\scases\sthat\swould\smake\sthis\sconversion\sa\slittle\sawkward\s-\sfor\sexample\sif\sa\suser\shas\sedited\sa\sURL\sin\sthe\saddress\sbar\sand\sadded\sillegal\scharacters,\sshould\sthe\scommand\sconclude\sthat\sthe\sentire\sURL\sneeds\sconversion\sand\sconvert\sany\sexisting\s"%"\sagain?\s\sWhat\sif\san\sexisting\s"%"\sis\snot\sfollowed\sby\sa\svalid\shexadecimal\scode?\sShould\s"+"\sbe\sconsidered\sa\svalid\sconversion\sof\sthe\sspace\scharacter,\sor\sshould\sit\sbe\sconverted\sto\s"%2B"?\s\sI\swonder\show\sthe\sPython\slibrary\sresolves\sproblems\slike\sthis.\r\n\r\nThe\scommand\shttp::geturl\sexpects\sa\svalid\sURL.\sHowever,\sthe\shttp\slibrary\scould\sprovide\scommands\sto\sencode\sa\sURL\sbefore\spassing\sit\sto\shttp::geturl.\r\n\r\nIn\sthe\smeantime,\sif\syou\sknow\sthat\sthe\sURL\spath\sneeds\sencoding,\sthe\sfollowing\scode\swill\sdo\sit:\r\n\r\npackage\srequire\shttp\r\npackage\srequire\suri\r\n\r\nproc\surlEncodePath\s{url}\s{\r\n\s\s\s\sset\ssplits\s[uri::split\s$url]\r\n\s\s\s\sset\sencPathList\s{}\r\n\s\s\s\sset\spath\s[dict\sget\s$splits\spath]\r\n\s\s\s\sset\spathList\s[split\s$path\s/]\r\n\s\s\s\sforeach\sel\s$pathList\s{\r\n\s\s\s\s\s\s\s\slappend\sencPathList\s[http::mapReply\s$el]\r\n\s\s\s\s}\r\n\s\s\s\sset\spath\s[join\s$encPathList\s/]\r\n\s\s\s\sdict\sset\ssplits\spath\s$path\r\n\s\s\s\suri::join\s{*}$splits\r\n}\r\n\r\nset\surl\shttp://127.0.0.1:33543/hub/session/fedc2754-770e-4b3a-9c1e-2fb16d0e0eaf/element/{56dcfe8e-c512-4dbf-a37a-4dbfb6d14b98}/value\r\n\r\nurlEncodePath\s$url\r\n\r\n-\sreturns\s-\r\n\r\nhttp://127.0.0.1:33543/hub/session/fedc2754-770e-4b3a-9c1e-2fb16d0e0eaf/element/%7B56dcfe8e-c512-4dbf-a37a-4dbfb6d14b98%7D/value
J login kjnash
J mimetype text/plain
K 5f923c60b2f8e9ccbf5702d673c25b09afb460be
U kjnash
Z ec2b8be9fccd16b7a8c20e46968c4a8e