Skip to content

Add HTTP Headers support to the form block configuration#22

Merged
ericof merged 2 commits into
mainfrom
issue-21
Jul 7, 2026
Merged

Add HTTP Headers support to the form block configuration#22
ericof merged 2 commits into
mainfrom
issue-21

Conversation

@ericof

@ericof ericof commented Jul 7, 2026

Copy link
Copy Markdown
Member

What

Adds support for forwarding request HTTP headers from the form block
configuration into the administration email — the frontend half of #19's
httpHeaders gap — and fixes a small i18n rendering bug in the thank-you help
text.

Changes

Backend (5272165)

  • Forward the request headers named in the block's httpHeaders field into the
    admin email. The field is now a newline-separated list of header names
    (matching the frontend textarea); each is normalised and read via
    request.getHeader.
  • Extracted the header-collection logic into utils.request_headers_from_block.
  • Reworked SchemaFormBlock to the functional TypedDict syntax so it can
    carry the @type key, mark optional keys NotRequired, and add httpHeaders
    and captcha_props.
  • Added a block_info test fixture and covered the new helper.

Frontend (ee9851b)

  • Added an HTTP Headers textarea to the schema form block settings (shown
    when sending to the administration email), one header name per line.
  • Regenerated the locale catalogs for the new messages.
  • Fixed the thank-you message help text: escaped the ${field_id} /
    ${formfields} hints so react-intl renders them literally instead of dropping
    them as missing ICU variables.

Testing

  • Backend and frontend lint + test suites run locally (green).

Related issue

Closes #21

ericof added 2 commits July 7, 2026 14:35
Forward request HTTP headers named in the block's `httpHeaders` field into the
administration email. The field is now a newline-separated list of header names
(matching the frontend textarea); each name is normalised and looked up via
`request.getHeader`.

- Extract the header-collection logic into `utils.request_headers_from_block`.
- Rework `SchemaFormBlock` to the functional TypedDict syntax so it can carry
  the `@type` key, mark optional keys `NotRequired`, and add `httpHeaders` and
  `captcha_props`.
- Add a `block_info` test fixture and cover the new helper.

Refs #21
Add an `httpHeaders` textarea to the schema form block settings (shown when
sending to the administration email), letting editors list request headers to
forward, one per line. Regenerate the locale catalogs for the new messages.

Also fix the thank-you message help text: escape the `${field_id}` and
`${formfields}` hints so react-intl renders them literally instead of dropping
them as missing ICU variables.

Refs #21
@ericof ericof requested a review from pbauer July 7, 2026 17:40
@ericof ericof merged commit 5a9a91e into main Jul 7, 2026
24 checks passed
@ericof ericof deleted the issue-21 branch July 7, 2026 17:46
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.

Add httpHeaders support to the form block configuration (frontend)

1 participant