Skip to content

[0.42-r2 H1] enhanced submit URL ignores form action — submitter.formAction is always truthy #576

Description

@SisyphusZheng

Severity: high · Category: implementation bug

Evidence. packages/adapter-vite/src/internal/ssg/entry-generators.ts (in __onSubmit): var actionUrl = (submitter && submitter.formAction) || form.action || window.location.href;. The formAction IDL attribute returns the DOCUMENT URL when the submitter has no formaction attribute, so it always wins over form.action.

Repro (verified in browser). Page at /live?x=1 with <form action="/other" method="post" data-open-enhance> and a plain submit button: submitter.formAction === http://host/live?x=1, so the enhanced POST goes to /live?x=1, while the native POST (no JS) correctly goes to /other — the two channels disagree (ADR-0120 rule 2).

Fix. Only honor formAction when the attribute is present: (submitter && submitter.hasAttribute('formaction') && submitter.formAction) || form.action || window.location.href.

Acceptance. e2e: enhanced submit of <form action="/other-route"> with an attribute-less submitter POSTs to /other-route; the formaction case keeps working.


Filed from the 0.42 round-2 review (docs/audit/2026-07-28-alpha5-round2-review.md). Target line: 0.42.0-alpha.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.42.0-alpha.60.42 round-2 review remediation (morph client hardening)bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions