-
Notifications
You must be signed in to change notification settings - Fork 971
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13722 +/- ##
==========================================
- Coverage 56.52% 56.52% -0.01%
==========================================
Files 283 283
Lines 28817 28819 +2
Branches 4777 4778 +1
==========================================
Hits 16289 16289
- Misses 12528 12530 +2
|
js/lib/request.js
Outdated
@@ -49,8 +49,15 @@ module.exports.request = (options, callback) => { | |||
}) | |||
} | |||
|
|||
let urlParsed = null | |||
try { | |||
urlParsed = urlParse(options.url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure this fixes the crash? muon.url.parse
doesn't throw an error for most invalid URLs:
if the crash is because the URL is undefined, you could just replace this check with if (typeof options.url !== 'string') { return callback(new Error('URL is not valid')) }
. then we wouldn't need to do url.parse
on the URL unless we are in development mode (https://github.com/brave/browser-laptop/pull/13722/files#diff-2565914e73f517d565765ef02f30d306R59)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@diracdeltas can you please re-review |
8e805f9
to
5b9989c
Compare
Resolves brave#12826 Auditors: Test Plan:
5b9989c
to
4a7908f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Resolves #12826
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests