Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Don't allocate the FormFeature eagerly per request #880

@davidfowl

Description

@davidfowl

Today, in order to pass the form options to the FormFeature, we eagerly allocate it here

var formFeature = new FormFeature(httpContext.Request, _formOptions);
. We should find a creative way to avoid doing this so eagerly in the common cases. Here are some options:

  • Invent a new way to pass things to features lazily (hard, we tried this and ended up with crazy things)
  • Only new up the FormOptions if they were overridden. We'd need a way to detect if the FormOptions were actually set. This is doable but could get ugly as there's no way to detect if options were configured. /cc @HaoK
  • Only set the FormFeature if the request is a POST and HasFormContentType. Gross, but would be more pay for play than what we have today.

/cc @vancem @Tratcher

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions