postman-code-generators
postman-code-generators copied to clipboard
replaced encodeURI with sdk.Url, issue #435
Replaced encodeURI
function with sdk.Url(urlString)
from postman-collection
to parse the URL
One of test in golang is failing because the generated code snippet includes url := "https://google.com/"
instead of url := "https://google.com"
Can someone help me with this? @webholik
Made a few changes in test files as mentioned in #438
@webholik I have made the necessary changes, however url.toString()
method doesn't URL encode '
(single-quote) and "
(double-quote) character.
@webholik the test fails as it doesn't URL encode '
and "
character.
I think a better approach would be to parse URLs using postman-collection
only but then put checks if protocol is empty (and any other conditions that I might have missed)
Something like
finalUrl = `${url.protocol ? `${url.protocol}://` : '' }${url.getRemote()}${finalUrl.getPathWithQuery(true)}`