From a5d029868c4d252585c29968f50f22f05efa495e Mon Sep 17 00:00:00 2001 From: "chenghe.zhang" Date: Tue, 14 Apr 2015 13:21:30 +0800 Subject: [BugFix][Browser]Can't download music from music.baidu.com [Solution Description] Can not download music from music.baidu.com The Referer is Empty [Other Info] modified: src/com/android/browser/DownloadHandler.java Change-Id: If696c2ace282ec01f95476a9907fd6c7303bfb9c (cherry picked from commit 2db66392f651d0b306e9921a9b005c6ed1361428) --- src/com/android/browser/DownloadHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/com/android/browser/DownloadHandler.java (limited to 'src/com/android/browser/DownloadHandler.java') diff --git a/src/com/android/browser/DownloadHandler.java b/src/com/android/browser/DownloadHandler.java old mode 100644 new mode 100755 index 208d4ce..5fc5b79 --- a/src/com/android/browser/DownloadHandler.java +++ b/src/com/android/browser/DownloadHandler.java @@ -214,7 +214,9 @@ public class DownloadHandler { String cookies = CookieManager.getInstance().getCookie(url, privateBrowsing); request.addRequestHeader("cookie", cookies); request.addRequestHeader("User-Agent", userAgent); - request.addRequestHeader("Referer", referer); + if (!TextUtils.isEmpty(referer)) { + request.addRequestHeader("Referer", referer); + } request.setNotificationVisibility( DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); if (mimetype == null) { -- cgit v1.1