cli icon indicating copy to clipboard operation
cli copied to clipboard

feature(forms-submission): re-consider current implementation

Open erezrokah opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Form supports was implemented a while back in https://github.com/netlify/cli/pull/780. The current implementation looks at requests and tries to detect if they are form submissions (by looking at the request method and content-type), and invoke the submission-created handler accordingly.

That implementation as a few disadvantages:

  1. It can't include any information that wasn't sent by the browser in the functions event object. See issue
  2. It will detect any POST request with a matching content-type as a form submission and trigger the handler, where it should only track forms submissions.

Describe the solution you'd like

Ideally the CLI should parse the HTML to identify forms and link those to submissions

Describe alternatives you've considered

Keeping things as they are

Additional context

See https://github.com/netlify/cli/issues/447

erezrokah avatar Nov 17 '21 10:11 erezrokah

Adding #1610 as another place where our CLI handling of forms is different from what we use on netlify.com

When we discussed it with the team, the solution we saw was redesigning the way we handle form submissions.

minivan avatar Nov 18 '21 10:11 minivan