Repository navigation
Conversation
| } | ||
|
|
||
| public DefaultHttpContext(IFeatureCollection features) | ||
| : this(new FeatureCollection(), FormOptions.Default) |
There was a problem hiding this comment.
Shouldn’t we be passing the feature collection and not a new one?
|
|
||
| // featurecollection is set. all cached interfaces are null. | ||
| var context = new DefaultHttpContext(features); | ||
| var context = new DefaultHttpContext(features, FormOptions.Default); |
There was a problem hiding this comment.
Make sure we validate the default ctor as well
9aff7c4 to
d1649ea
Compare
| { | ||
| public class FormOptions | ||
| { | ||
| public static readonly FormOptions Default = new FormOptions(); |
There was a problem hiding this comment.
We can't make a mutable instance a public static. Make it internal?
| private readonly static Func<IFeatureCollection, IHttpRequestFeature> _nullRequestFeature = f => null; | ||
| private readonly static Func<IFeatureCollection, IQueryFeature> _newQueryFeature = f => new QueryFeature(f); | ||
| private readonly static Func<HttpRequest, IFormFeature> _newFormFeature = r => new FormFeature(r); | ||
| private readonly static Func<(HttpRequest request, FormOptions options), IFormFeature> _newFormFeature = (r) => new FormFeature(r.request, r.options ?? FormOptions.Default); |
There was a problem hiding this comment.
Custom struct or another Fetch overload?
|
@davidfowl @Tratcher is this still relevant/useful in your opinion? If so, let's move it forward. If not, let's get it closed. Ben, thanks for the PR! |
|
@benaadams I'm going to move this to 3.0 |
|
@davidfowl I'm about to merge this repo into aspnet/AspNetCore. If you'd like this PR merged, can you bring it in today? If not, I'm going to close this and you'll have to re-open the PR. |
|
@natemcmaster close it and I'll make @benaadams reopen it 😄 |


Update to #925
Resolves #924 "FeatureCache is over-checked and over-reset"
Resolves #677 "FormFeature allocates when unused"
Resolves #880 "Don't allocate the FormFeature eagerly per request"
/cc @davidfowl