Skip to content

1、修复通过nginx代理drpyS后,ext传参,protocol获取错误的问题; 2、添加哔哩收藏源,支持播放个人收藏夹视频; #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
修复通过nginx代理drpyS后,ext传参,protocol获取错误的问题
  • Loading branch information
yutons committed Feb 13, 2025
commit c0def5a14ffc64fa2b0f863bdaa6f8a58e4a70d2
6 changes: 3 additions & 3 deletions controllers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default (fastify, options, done) => {
const query = method === 'GET' ? request.query : request.body;
const moduleExt = query.extend || '';
// console.log('moduleExt:', typeof moduleExt, moduleExt);
const protocol = request.protocol;
const protocol = request.headers['x-forwarded-proto'] || (request.socket.encrypted ? 'https' : 'http');
const hostname = request.hostname;
// const proxyUrl = `${protocol}://${hostname}${request.url}`.split('?')[0].replace('/api/', '/proxy/') + '/?do=js';
// const proxyUrl = `${protocol}://${hostname}/proxy/${moduleName}/?do=js`;
Expand Down Expand Up @@ -200,7 +200,7 @@ export default (fastify, options, done) => {
const rangeHeader = request.headers.range; // 获取客户端的 Range 请求头

const moduleExt = query.extend || '';
const protocol = request.protocol;
const protocol = request.headers['x-forwarded-proto'] || (request.socket.encrypted ? 'https' : 'http');
const hostname = request.hostname;

const publicUrl = `${protocol}://${hostname}/public/`;
Expand Down Expand Up @@ -305,7 +305,7 @@ export default (fastify, options, done) => {
return reply.status(404).send({error: `解析 ${jxName} not found`});
}
const moduleExt = query.extend || '';
const protocol = request.protocol;
const protocol = request.headers['x-forwarded-proto'] || (request.socket.encrypted ? 'https' : 'http');
const hostname = request.hostname;

const publicUrl = `${protocol}://${hostname}/public/`;
Expand Down