fix: merge PR #409 (home page redirect) — resolve conflict, fix test mocks, fix lint#482
Closed
fix: merge PR #409 (home page redirect) — resolve conflict, fix test mocks, fix lint#482
Conversation
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
…rs, post-invoice controller
…ts-pull-409 # Conflicts: # src/handlers/request-handlers/root-request-handler.ts Co-authored-by: cameri <378886+cameri@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
cameri
April 18, 2026 05:12
View session
Copilot stopped work on behalf of
cameri due to an error
April 18, 2026 05:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 intomainby resolving the merge conflict and fixing related lint/test issues.Changes
root-request-handler.ts): Kept PR'simport { path, pathEq } from 'ramda'—pathEqis required by the handler's admission-fee logicroot-request-handler.ts,get-privacy-request-handler.ts): Reordered to satisfysort-importslint rule (multiple-member imports before default imports)root-request-handler.spec.ts): Theacceptslibrary readsreq.headersdirectly (not viareq.header()), so mock objects were missing the property — causing all HTML-path tests to throw at runtime. Fixed by adding properheadersto mock request objects.Related Issue
Closes #269
Types of changes
Checklist