-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api-minor] Move the addDefaultProtocolToUrl
/tryConvertUrlEncoding
functionality into the createValidAbsoluteUrl
function
#14081
[api-minor] Move the addDefaultProtocolToUrl
/tryConvertUrlEncoding
functionality into the createValidAbsoluteUrl
function
#14081
Conversation
…` functionality into the `createValidAbsoluteUrl` function Having recently worked with, and reviewed patches touching, this code it seemed that it's probably not a bad idea to move that functionality into `createValidAbsoluteUrl` as new options instead. For the `addDefaultProtocolToUrl` functionality in particular, the existing helper function was not only moved but slightly improved as well. Looking at the code, I realized that there's a small risk that it would incorrectly match a *relative* URL-string too. With these changes, the `createValidAbsoluteUrl` call-sites in the `src/core/`-code can be simplified a little bit. *Please note:* This patch may, indirectly, change the format of the `unsafeUrl`-property returned with relevant Annotations and OutlineItems; hence the `api-minor` tag. However, I'd argue that it's actually more correct this way since the whole purpose of `unsafeUrl` is/was to return the URL data as-is without any parsing done.
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/04f819f5bbe8542/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/5ec109e1caafb11/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/04f819f5bbe8542/output.txt Total script time: 2.77 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/5ec109e1caafb11/output.txt Total script time: 6.72 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c5e2368148259c1/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/c5e2368148259c1/output.txt Total script time: 4.20 mins Published |
Good idea; thanks! |
Having recently worked with, and reviewed patches touching, this code it seemed that it's probably not a bad idea to move that functionality into
createValidAbsoluteUrl
as new options instead.For the
addDefaultProtocolToUrl
functionality in particular, the existing helper function was not only moved but slightly improved as well. Looking at the code, I realized that there's a small risk that it would incorrectly match a relative URL-string too.With these changes, the
createValidAbsoluteUrl
call-sites in thesrc/core/
-code can be simplified a little bit.Please note: This patch may, indirectly, change the format of the
unsafeUrl
-property returned with relevant Annotations and OutlineItems; hence theapi-minor
tag.However, I'd argue that it's actually more correct this way since the whole purpose of
unsafeUrl
is/was to return the URL data as-is without any parsing done.