File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,18 @@ const getRandomIP = () => {
7676 * @returns
7777 */
7878const home = async ( pathname ) => {
79- let url = `https://raw.githubusercontent.com/adams549659584/go-proxy-bingai/master/cloudflare/index.html` ;
79+ const baseUrl = 'https://raw.githubusercontent.com/adams549659584/go-proxy-bingai/master/' ;
80+ let url ;
8081 // if (pathname.startsWith('/github/')) {
8182 if ( pathname . indexOf ( '/github/' ) === 0 ) {
8283 url = pathname . replace ( '/github/' , 'https://raw.githubusercontent.com/adams549659584/go-proxy-bingai/master/' ) ;
84+ } else {
85+ url = baseUrl + 'cloudflare/index.html' ;
8386 }
8487 const res = await fetch ( url ) ;
8588 const newRes = new Response ( res . body , res ) ;
8689 if ( pathname === '/' ) {
90+ newRes . headers . delete ( 'content-security-policy' ) ;
8791 newRes . headers . set ( 'content-type' , 'text/html; charset=utf-8' ) ;
8892 }
8993 return newRes ;
You can’t perform that action at this time.
0 commit comments