Conversation
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
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.
What
Adds support for forwarding request HTTP headers from the form block
configuration into the administration email — the frontend half of #19's
httpHeadersgap — and fixes a small i18n rendering bug in the thank-you helptext.
Changes
Backend (
5272165)httpHeadersfield into theadmin email. The field is now a newline-separated list of header names
(matching the frontend textarea); each is normalised and read via
request.getHeader.utils.request_headers_from_block.SchemaFormBlockto the functionalTypedDictsyntax so it cancarry the
@typekey, mark optional keysNotRequired, and addhttpHeadersand
captcha_props.block_infotest fixture and covered the new helper.Frontend (
ee9851b)when sending to the administration email), one header name per line.
${field_id}/${formfields}hints so react-intl renders them literally instead of droppingthem as missing ICU variables.
Testing
Related issue
Closes #21