Skip to content

Instantly share code, notes, and snippets.

View chengxiaobo00's full-sized avatar

Cheng J.M. chengxiaobo00

View GitHub Profile
@chengxiaobo00
chengxiaobo00 / auto-add-ssl-workers.js
Created November 1, 2025 14:23 — forked from eooce/auto-add-ssl-workers.js
auto-add-ssl-workers
export default {
async fetch(request, env, ctx) {
const url = new URL(request.url);
// 处理 API 请求:支持 POST (/api/add-ssl) 和 GET (/?...)
if (
(url.pathname === '/api/add-ssl' && request.method === 'POST') ||
(url.pathname === '/' && request.method === 'GET' && url.searchParams.has('zoneId'))
) {
return handleApiRequest(request, url.searchParams);