Skip to content

Instantly share code, notes, and snippets.

@dreamhall-520
dreamhall-520 / auto-add-ssl-workers.js
Created October 24, 2025 20:32 — 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);