Skip to content

form-wrapper: allow any frame-ancestor - #2321

Merged
alxndrsn merged 17 commits into
getodk:nextfrom
alxndrsn:allow-form-embed
Nov 13, 2026
Merged

alxndrsn merged 17 commits into
getodk:nextfrom
alxndrsn:allow-form-embed

Conversation

@alxndrsn

@alxndrsn alxndrsn commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2314

What has been done to verify that this works as intended?

  • ci

Why is this the best possible solution? Were any other approaches considered?

Detection of single-use forms is tricky, but checking for the st query param is deemed good-enough here.

How does this change impact users? Describe intentional behavior changes from code updates. What are the regression risks?

Should only relax embedding rules, so low risk of breaking anything.

Is this change user-facing or otherwise noteworthy to users? If so, please add an entry for it in CHANGELOG.md.

  • update CHANGELOG

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

@matthew-white matthew-white linked an issue Nov 9, 2026 that may be closed by this pull request
@lognaturel

Copy link
Copy Markdown
Member

I think we can use the presence of the st query param to apply the different rules. Something like

map $arg_st $frame_ancestors {
    default "'none'";
    ~.+     "*";
}

The query param needs to have a value to have any chance of being a valid Public Access Link so it's fine and good for a URL with only st= (no value) to be unembeddable.

@alxndrsn
alxndrsn marked this pull request as ready for review November 12, 2026 15:38

@lognaturel lognaturel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick wording change please! There's a chance I flagged that I can't convince myself is necessary but I also don't think it's problematic.

Comment thread test/nginx/src/mocha/nginx.spec.js Resolved
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ $spa_html;
try_files $uri $uri/ "$spa_html$is_args$args";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the fix for Enketo forms not working currently? Is it for sure needed? I thought this was the default nginx behavior!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed, otherwise $arg_st is empty when re-evaluated after the uri rewrite.

Comment thread test/nginx/src/mocha/nginx.spec.js Resolved
Comment thread test/nginx/src/mocha/nginx.spec.js Resolved
@alxndrsn
alxndrsn merged commit eb95a1e into getodk:next Nov 13, 2026
7 checks passed
@alxndrsn
alxndrsn deleted the allow-form-embed branch November 13, 2026 07:29
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.

Allow iframe embed of Public Access Links

2 participants