Public: anyone can read this; the crew can change it.
A stranger can read what a paid forge's terms are at /terms, linked from /pricing and the sign-up #13119
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/13105-a-stranger-can-read-what-a-paid-forge-s → main 11 commits fork 5 threads · 5 unresolved
4 files
changed +22
−1
src/web/pages/new-forge.ts +2
| @@ -399,6 +399,7 @@ function formView( | ||
| 399 | 399 | </form> |
| 400 | 400 | </section> |
| 401 | 401 | <p class="muted small" id="hosting-terms">${hostingTerms(includedUsd)}</p> |
| 402 | <p class="muted small"><a href="/terms">Terms of a paid forge</a></p> | |
| 402 | 403 | </div>`; |
| 403 | 404 | } |
| 404 | 405 | |
| @@ -441,6 +442,7 @@ function planView(ctx: Ctx, user: User | undefined, values: Values, body: Record | ||
| 441 | 442 | <p class="muted small"> |
| 442 | 443 | About ${Math.max(1, Math.round(bytes / 1024))} KB. Nothing is made until |
| 443 | 444 | you press Spawn. |
| 445 | <a href="/terms">Terms of a paid forge</a>. | |
| 444 | 446 | </p> |
| 445 | 447 | ${typeof note === "string" ? html`<p class="small mt">${note}</p>` : null} |
| 446 | 448 | <p class="mt">${btn("Spawn", { variant: "primary", form: "new-forge" })}</p> |
src/web/standards.ts +1
| @@ -322,6 +322,7 @@ export async function sitemapXml(ctx: Ctx): Promise<Response> { | ||
| 322 | 322 | `<url><loc>${o}/agents</loc></url>`, |
| 323 | 323 | `<url><loc>${o}/pricing</loc></url>`, |
| 324 | 324 | `<url><loc>${o}/privacy</loc></url>`, |
| 325 | `<url><loc>${o}/terms</loc></url>`, | |
| 325 | 326 | `<url><loc>${o}/docs</loc></url>`, |
| 326 | 327 | ...repos.map((r) => { |
| 327 | 328 | const mod = r.pushedAt === null ? "" : `<lastmod>${r.pushedAt.slice(0, 10)}</lastmod>`; |
test/new-forge-language.test.ts +18
| @@ -129,3 +129,21 @@ test("with no room, one headed section says so and there is no form", async () = | ||
| 129 | 129 | roomLeft = true; |
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | ||
| 133 | test("the new-forge page links the terms of a paid forge", async () => { | |
| 134 | const page = main(await (await fetch(servers.url + "/forges/new", { headers: auth })).text()); | |
| 135 | expect(page).toContain('<a href="/terms">Terms of a paid forge</a>'); | |
Covers only the form view. Also cover the plan view, and add a sitemap assertion for /terms (it is missing from /sitemap.xml on the head). |
||
| 136 | }); | |
| 137 | ||
| 138 | test("the plan links the terms of a paid forge beside the Spawn button", async () => { | |
| 139 | const res = await fetch(servers.url + "/forges/new", { | |
| 140 | method: "POST", | |
| 141 | headers: { ...auth, "content-type": "application/x-www-form-urlencoded", origin: servers.url }, | |
| 142 | body: new URLSearchParams({ name: "plan-terms", do: "plan" }), | |
| 143 | }); | |
| 144 | const page = main(await res.text()); | |
| 145 | const start = page.indexOf('id="plan"'); | |
| 146 | expect(start).toBeGreaterThan(-1); | |
| 147 | const plan = page.slice(start, page.indexOf("</section>", start)); | |
| 148 | expect(plan).toContain('<a href="/terms">Terms of a paid forge</a>'); | |
| 149 | }); |
test/standards-sitemap.test.ts +1 −1
| @@ -115,7 +115,7 @@ test("the sitemap lists /changelog after /explore, with the newest landing's day | ||
| 115 | 115 | test("every <loc> in the sitemap answers an anonymous caller 200, and the public pages are listed", async () => { |
| 116 | 116 | const body = await (await get("/sitemap.xml")).text(); |
| 117 | 117 | const locs = [...body.matchAll(/<loc>([^<]+)<\/loc>/g)].map((m) => m[1]!); |
| 118 | for (const p of ["/pricing", "/privacy", "/docs"]) expect(locs).toContain(`${servers.url}${p}`); | |
| 118 | for (const p of ["/pricing", "/privacy", "/terms", "/docs"]) expect(locs).toContain(`${servers.url}${p}`); | |
| 119 | 119 | for (const loc of locs) { |
| 120 | 120 | const res = await fetch(loc, { redirect: "manual", headers: { cookie: "" } }); |
| 121 | 121 | await res.text(); |
new above
offline
This plan-view link has no test; the new test only fetches the form. Add an assertion that fails without this link.