diff options
author | chenghe.zhang <chenghe.zhang@ck-telecom.com> | 2015-04-14 13:21:30 +0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-11-07 13:58:03 -0800 |
commit | a5d029868c4d252585c29968f50f22f05efa495e (patch) | |
tree | 247191acc4994927a211902d5aa779fcaf6ce1cb /src/com/android/browser/DownloadHandler.java | |
parent | e09c58bc8d01318ad9bf488e2de849771d40b67f (diff) | |
download | packages_apps_Browser-a5d029868c4d252585c29968f50f22f05efa495e.zip packages_apps_Browser-a5d029868c4d252585c29968f50f22f05efa495e.tar.gz packages_apps_Browser-a5d029868c4d252585c29968f50f22f05efa495e.tar.bz2 |
[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)
Diffstat (limited to 'src/com/android/browser/DownloadHandler.java')
-rwxr-xr-x[-rw-r--r--] | src/com/android/browser/DownloadHandler.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/browser/DownloadHandler.java b/src/com/android/browser/DownloadHandler.java index 208d4ce..5fc5b79 100644..100755 --- 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) { |