Files
gitlab-instance-0a899031_no…/app/https-upgrade.ts
2026-03-27 19:35:39 -05:00

13 lines
458 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 微信等环境可能以 http 打开 vip 域名,导致 Cookie/支付与 https 不一致。
* 在任意 JS 执行前立即跳转到 httpsmiddleware 之外的兜底)。
*/
export const httpsUpgradeScript = `
(function(){
var h=location.hostname;
if(h!=="vip.hackrobot.cn"&&h!=="www.vip.hackrobot.cn")return;
if(location.protocol!=="http:")return;
location.replace("https://"+h+location.pathname+location.search+location.hash);
})();
`;