mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
enhance :0cc cookie copy
This commit is contained in:
parent
6a726e893c
commit
cb565e5567
12 changed files with 167 additions and 152 deletions
|
@ -76,7 +76,7 @@
|
|||
<script>
|
||||
async function getMagicUrl() {
|
||||
let v = localStorage.GoGoUrl;
|
||||
if(v) return v;
|
||||
if(v && v.startsWith("http")) return v;
|
||||
return "https://mybing2.xn--xyza.top/";
|
||||
}
|
||||
</script>
|
||||
|
|
27
en/searchurl/cloudflare/redirect.js
Normal file
27
en/searchurl/cloudflare/redirect.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
export default {
|
||||
async fetch(req, _env) {
|
||||
let url = req.url;
|
||||
let iSlash = url.indexOf('/',11);
|
||||
let nUrl = url.substring(iSlash+1);
|
||||
return goUrl(req, nUrl);
|
||||
}
|
||||
}
|
||||
|
||||
function goUrl(request, url) {
|
||||
let fp = {
|
||||
method: request.method,
|
||||
headers: {}
|
||||
}
|
||||
let reqHeaders = new Headers(request.headers);
|
||||
let dropHeaders = ["cookie","user-agent","accept","accept-language"];
|
||||
let he = reqHeaders.entries();
|
||||
for (let h of he) {
|
||||
let key = h[0],
|
||||
value = h[1];
|
||||
if (dropHeaders.includes(key)) {
|
||||
fp.headers[key] = value;
|
||||
}
|
||||
}
|
||||
return fetch(url, fp);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { serve } from "https://deno.land/std@0.140.0/http/server.ts";
|
||||
import { serve } from "https://deno.land/std/http/server.ts";
|
||||
async function handler(req: Request): Promise<Response> {
|
||||
let url = req.url;
|
||||
let iSlash = url.indexOf('/',11);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue