diff --git a/src/index.js b/src/index.js index a7421d4..968d739 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,7 @@ function xmlResponse(content) { } function xmlError(message) { - return xmlResponse(`${escXml(message)}`); + return xmlResponse(`1${escXml(message)}`); } function escXml(s) { @@ -53,7 +53,7 @@ async function handleActivate(request, env) { const email = parseField(body, 'email') ?? ''; if (!serial_number || !product || !reg_key) { - return xmlError('Missing required fields'); + return xmlError('Invalid XML.'); } // Validate product exists diff --git a/wrangler.toml b/wrangler.toml index b884a03..314c884 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1,8 +1,13 @@ name = "cowl-licensing" main = "src/index.js" compatibility_date = "2024-01-01" +workers_dev = true + +routes = [ + { pattern = "licensing.componentowl.com/*", zone_name = "componentowl.com" } +] [[d1_databases]] binding = "DB" database_name = "cowl-licensing" -database_id = "TO_BE_FILLED" +database_id = "e350cc3b-e83f-49ef-949f-6a7ebbb4a189"