code review: bit stricter code path

This commit is contained in:
Raymond Hill 2018-02-18 06:08:48 -05:00
parent 16a7ba8f6e
commit c3f9f6b716
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 6 additions and 7 deletions

View File

@ -88,14 +88,13 @@ var RedirectEntry = function() {
// - https://bugzilla.mozilla.org/show_bug.cgi?id=998076
RedirectEntry.prototype.toURL = function(details) {
if ( this.warURL !== undefined ) {
if (
details instanceof Object === false ||
this.warURL !== undefined &&
details instanceof Object &&
details.requestType !== 'xmlhttprequest'
) {
return this.warURL + '?secret=' + vAPI.warSecret;
}
}
if ( this.data.startsWith('data:') === false ) {
if ( this.mime.indexOf(';') === -1 ) {
this.data = 'data:' + this.mime + ';base64,' + btoa(this.data);