Skip to content

Commit

Permalink
[Fix] 🐛 Vercel Deploy Chinese Q&A Error #409
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed May 8, 2024
1 parent ae5d85b commit 72aa358
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cloudflare/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,33 @@ export default {
return pass(request, cookies);
}

if (currentUrl.pathname.startsWith('/sydney')) {
const cookieStr = cookies;
cookies = '';
cookieStr.split(';').forEach(item => {
if (!item) {
return;
}
const arr = item.split('=');
const key = arr[0].trim();
const val = arr[1].trim();
if (key === 'KievRPSSecAuth') {
cookies += 'KievRPSSecAuth=' + val + '; ';
}
if (key === '_RwBf') {
cookies += '_RwBf=' + val + '; ';
}
if (key === 'MUID') {
cookies += 'MUID=' + val + '; ';
}
if (key === '_U') {
cookies += '_U=' + val + '; ';
}
if (key === 'cct=') {
cookies += 'cct=' + val + '; ';
}
})
}
newHeaders.set('Cookie', cookies);
const oldUA = request.headers.get('user-agent') || '';
const isMobile = oldUA.includes('Mobile') || oldUA.includes('Android');
Expand Down

0 comments on commit 72aa358

Please sign in to comment.