All new code requires tests to ensure against regressions.
However, if your PR contains zero code changes, feel free to select the checkmark below to indicate so.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
A recent PR re-enabled the use of URL to ensure we only redirect users to safe locations.
But there was some confusion about which URL module we wanted to use, because we had been importing a url module from NPM, but on that PR became aware that NodeJS has one included by default.
So this PR now uses NodeJS's url module, which changed the way we imported it. I've also gone ahead and added a test to ensure this works as expected, and redirects to the correct location.
Lastly in this PR, I've caused a malformed URL to actually return a server error rather than still attempt a redirect
Requirements
Filling out the template is required.
All new code requires tests to ensure against regressions.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
A recent PR re-enabled the use of
URL
to ensure we only redirect users to safe locations.But there was some confusion about which URL module we wanted to use, because we had been importing a
url
module from NPM, but on that PR became aware that NodeJS has one included by default.So this PR now uses NodeJS's
url
module, which changed the way we imported it. I've also gone ahead and added a test to ensure this works as expected, and redirects to the correct location.Lastly in this PR, I've caused a malformed URL to actually return a server error rather than still attempt a redirect