"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/protocol_filter.js" between
Signal-Desktop-1.40.0.tar.gz and Signal-Desktop-1.40.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

protocol_filter.js  (Signal-Desktop-1.40.0):protocol_filter.js  (Signal-Desktop-1.40.1)
skipping to change at line 29 skipping to change at line 29
const decoded = decodeURIComponent(targetUrl); const decoded = decodeURIComponent(targetUrl);
const withoutScheme = decoded.slice(isWindows ? 8 : 7); const withoutScheme = decoded.slice(isWindows ? 8 : 7);
const withoutQuerystring = _eliminateAllAfterCharacter(withoutScheme, '?'); const withoutQuerystring = _eliminateAllAfterCharacter(withoutScheme, '?');
const withoutHash = _eliminateAllAfterCharacter(withoutQuerystring, '#'); const withoutHash = _eliminateAllAfterCharacter(withoutQuerystring, '#');
return withoutHash; return withoutHash;
} }
function _createFileHandler({ userDataPath, installPath, isWindows }) { function _createFileHandler({ userDataPath, installPath, isWindows }) {
return (request, callback) => { return (request, callback) => {
let targetPath;
try {
targetPath = _urlToPath(request.url, { isWindows });
} catch (err) {
const errorMessage =
err && typeof err.message === 'string'
? err.message
: 'no error message';
console.log(
`Warning: denying request because of an error: ${errorMessage}`
);
// This is an "invalid URL" error. See [Chromium's net error list][0].
//
// [0]: https://source.chromium.org/chromium/chromium/src/+/master:net/bas
e/net_error_list.h;l=563;drc=a836ee9868cf1b9673fce362a82c98aba3e195de
return callback({ error: -300 });
}
// normalize() is primarily useful here for switching / to \ on windows // normalize() is primarily useful here for switching / to \ on windows
const target = path.normalize(_urlToPath(request.url, { isWindows })); const target = path.normalize(targetPath);
// here we attempt to follow symlinks to the ultimate final path, reflective of what // here we attempt to follow symlinks to the ultimate final path, reflective of what
// we do in main.js on userDataPath and installPath // we do in main.js on userDataPath and installPath
const realPath = fs.existsSync(target) ? fs.realpathSync(target) : target; const realPath = fs.existsSync(target) ? fs.realpathSync(target) : target;
// finally we do case-insensitive checks on windows // finally we do case-insensitive checks on windows
const properCasing = isWindows ? realPath.toLowerCase() : realPath; const properCasing = isWindows ? realPath.toLowerCase() : realPath;
if (!path.isAbsolute(realPath)) { if (!path.isAbsolute(realPath)) {
console.log( console.log(
`Warning: denying request to non-absolute path '${realPath}'` `Warning: denying request to non-absolute path '${realPath}'`
); );
 End of changes. 2 change blocks. 
1 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)