From 714bff1ec2bc4a4d25a25bee18e446ecfbff8bf6 Mon Sep 17 00:00:00 2001 From: Maxime LUCE Date: Wed, 18 Sep 2013 03:33:13 +0200 Subject: [PATCH] Fix Windows 8 HTMLAnchorElement return host:80 which force Basic Auth Header to replace options Auth Header --- www/windows8/FileTransferProxy.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/windows8/FileTransferProxy.js b/www/windows8/FileTransferProxy.js index dd8ff62..cbfcfd7 100644 --- a/www/windows8/FileTransferProxy.js +++ b/www/windows8/FileTransferProxy.js @@ -73,6 +73,7 @@ module.exports = { download:function(win, error, options) { var source = options[0]; var target = options[1]; + var headers = options[4] || {}; if (target === null || typeof target === undefined) { @@ -96,6 +97,13 @@ module.exports = { storageFolder.createFileAsync(fileName, Windows.Storage.CreationCollisionOption.generateUniqueName).then(function (storageFile) { var uri = Windows.Foundation.Uri(source); var downloader = new Windows.Networking.BackgroundTransfer.BackgroundDownloader(); + + if (headers) { + for (var header in headers) { + downloader.setRequestHeader(header, headers[header]); + } + } + download = downloader.createDownload(uri, storageFile); download.startAsync().then(function () { win(new FileEntry(storageFile.name, storageFile.path));