diff --git a/README.md b/README.md index 8f873f8..fe6d2f9 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ answers with a "check your inbox" page that links back to the site. `embed.js` w **CSP:** pass the page's `nonce` so the script runs, and allow pit.world: `connect-src 'self' https://pit.world; form-action 'self' https://pit.world`. If the request is -blocked anyway, the form says "Failed: could not reach pit.world" instead of doing nothing. +blocked anyway, the form says "Failed: could not reach the subscribe service" instead of doing nothing. Turn it off with `subscribe: false` (`--no-subscribe`). Installs before 0.3.0 cannot render the form; their footer shows a plain "Newsletter" link to the same page instead, from the @latest template. diff --git a/package.json b/package.json index b7cb67b..41484ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@profullstack/footer", - "version": "0.6.18", + "version": "0.6.19", "type": "module", "description": "Profullstack's distributed footer engine for remote, agent-friendly site branding and navigation.", "keywords": ["footer", "webring", "openwebring", "copyright", "react", "nextjs", "hono", "ssr"], diff --git a/src/subscribe.js b/src/subscribe.js index ed81627..f94634c 100644 --- a/src/subscribe.js +++ b/src/subscribe.js @@ -50,12 +50,12 @@ export function wireSubscribe(form) { say('Email confirmation sent to ' + email + '. Check your inbox.', 'ok'); form.reset(); } else { - say('Failed: ' + (body.error || reasons[body.status] || 'pit.world answered ' + res.status), 'error'); + say('Failed: ' + (body.error || reasons[body.status] || 'the subscribe service answered ' + res.status), 'error'); } }); }) .catch(function (err) { - say('Failed: could not reach pit.world (' + ((err && err.message) || err) + ')', 'error'); + say('Failed: could not reach the subscribe service (' + ((err && err.message) || err) + ')', 'error'); }) .then(function () { if (button) button.disabled = false; diff --git a/test/subscribe.test.js b/test/subscribe.test.js index 06baee8..876314c 100644 --- a/test/subscribe.test.js +++ b/test/subscribe.test.js @@ -79,13 +79,13 @@ test('a refusal says Failed with the reason', async () => { assert.equal((await submitWith(reply(400, { ok: false, status: 'undeliverable' }))).msg.textContent, "Failed: that address's domain can't receive email"); assert.equal((await submitWith(reply(429, { error: 'Too many requests. Try again shortly.' }))).msg.textContent, 'Failed: Too many requests. Try again shortly.'); const r = await submitWith(reply(502, {})); - assert.equal(r.msg.textContent, 'Failed: pit.world answered 502'); + assert.equal(r.msg.textContent, 'Failed: the subscribe service answered 502'); assert.equal(r.msg.attrs['data-state'], 'error'); }); test('a blocked or failed request says so instead of doing nothing', async () => { const r = await submitWith(() => Promise.reject(new TypeError('Failed to fetch'))); - assert.equal(r.msg.textContent, 'Failed: could not reach pit.world (Failed to fetch)'); + assert.equal(r.msg.textContent, 'Failed: could not reach the subscribe service (Failed to fetch)'); assert.equal(r.button.disabled, false); });