Skip to content

fix: merge PR #409 (home page redirect) — resolve conflict, fix test mocks, fix lint#482

Closed
Copilot wants to merge 11 commits intomainfrom
copilot/fix-conflicts-pull-409
Closed

fix: merge PR #409 (home page redirect) — resolve conflict, fix test mocks, fix lint#482
Copilot wants to merge 11 commits intomainfrom
copilot/fix-conflicts-pull-409

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

Previously, visiting the relay's home page resulted in a 301 permanent redirect to /invoices when payments were enabled, or a bare text response when payments were disabled. This PR brings in the changes from #409 with conflicts resolved.

Description

Merges PR #409 (fix/home-redirect-302) changes into main by resolving the merge conflict and fixing related lint/test issues.

Changes

  • Merge conflict (root-request-handler.ts): Kept PR's import { path, pathEq } from 'ramda'pathEq is required by the handler's admission-fee logic
  • Import order (root-request-handler.ts, get-privacy-request-handler.ts): Reordered to satisfy sort-imports lint rule (multiple-member imports before default imports)
  • Test mocks (root-request-handler.spec.ts): The accepts library reads req.headers directly (not via req.header()), so mock objects were missing the property — causing all HTML-path tests to throw at runtime. Fixed by adding proper headers to mock request objects.

Related Issue

Closes #269

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • All new and existing tests passed.

CKodidela and others added 11 commits April 9, 2026 08:31
Previously, visiting the relay's home page resulted in a 301 permanent
redirect to /invoices when payments were enabled, or a bare text response
when payments were disabled. Neither gave relay operators a real home page,
and the 301 caused browsers to cache the redirect permanently — making it
impossible to change home page behaviour later without users clearing cache.

Changes:
- / now always serves index.html, a proper home page that works with and
  without payments. When admission fees are enabled, a payment card and
  link to /invoices is shown; otherwise an "open relay" card is shown.
  Template variables: {{name}}, {{description}}, {{relay_url}}, {{amount}},
  {{payments_section_class}}, {{no_payments_section_class}}, {{nonce}}.
- The old index.html (admission fee form) is renamed to get-invoice.html,
  served by GET /invoices. The ToS link now points to /terms instead of
  an embedded modal.
- The old invoices.html (payment result page) is renamed to post-invoice.html,
  served after POST /invoices. The rename reflects what the page actually is.
- privacy.html template added and served at GET /privacy.
- Old index.html and invoices.html remain in resources/ for reference.
  cache, request handlers, and invoice controller
…ts-pull-409

# Conflicts:
#	src/handlers/request-handlers/root-request-handler.ts

Co-authored-by: cameri <378886+cameri@users.noreply.github.com>
@cameri cameri closed this Apr 18, 2026
Copilot stopped work on behalf of cameri due to an error April 18, 2026 05:12
Copilot AI requested a review from cameri April 18, 2026 05:12
@cameri cameri deleted the copilot/fix-conflicts-pull-409 branch April 18, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User-modifiable templates need work

3 participants