alist-org / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
39.38k stars 5.11k forks source link

网易云出现mixed content / Mixed content issue with Netease(163music) driver #6556

Closed axyn45 closed 4 weeks ago

axyn45 commented 1 month ago

Please make sure of the following things

AList Version / AList 版本

v3.35.0

Driver used / 使用的存储驱动

网易云音乐云盘

Describe the bug / 问题描述

网易云驱动加载的歌曲和歌词链接为http协议,在部署证书的网站上会出现mixed content错误导致歌词无法正常加载。 image 建议增加对用户当前协议的识别并替换歌曲资源链接中的scheme

Reproduction / 复现链接

https://drive.okkk.cc/netease/%E9%AB%98%E6%9D%89%E3%81%95%E3%81%A8%E7%BE%8E%20-%20%E7%99%BE%E6%81%8B%E6%AD%8C.flac

Config / 配置

image

Logs / 日志

No response

liuycy commented 4 weeks ago

歌词地址 host 是用 GetApiUrl 拼接的,默认配置的话走 http_port 的话是返回 http 的,试试 配置文件 里 scheme 设置一下 https 相关字段,修改端口转发到 https 端口看看能不能行?

image
axyn45 commented 4 weeks ago

歌词地址 host 是用 GetApiUrl 拼接的,默认配置的话走 http_port 的话是返回 http 的,试试 配置文件 里 scheme 设置一下 https 相关字段,修改端口转发到 https 端口看看能不能行?

”我用了反向代理,证书不是直接配置在alist里。希望能通过识别x-forwarded-proto这样的头部来判断当前用户是否为https连接, #6559 似乎就是这样解决的。“

原本是想这么说的,但是刚刚发现我的cdn回源时没有配置x-forwarded-proto导致了alist没能正确识别协议。现在添加了响应头后问题解决了。所以似乎 #6559 并没有解决问题,因为GetApiUrl中自带对X-Forwarded-Proto的识别。