Closed albinsunnanbo closed 4 years ago
Is this related to the fact that the middleware is an active middleware?
It looks like the HttpRequestData.Form should only mind about fields AuthServices actually uses itself and be resilient against unknown data.
A suggestion would be to instead of parsing all formData in HttpRequestData.InitBasicFields encapsulate form data in a lookup class that find fields dynamically on each lookup. This way we would only look att fields that we actually expects to use.
Without doing any profiling it does not look like we use it frequently. Thus keeping the data in a dictionary should not be required for performance reasons.
With the Owin middleware switched over to passive this shouldn't be a problem any more and the age and inactivity on the issue suggests it's not a problem.
Reproduction Use the code in the branch https://github.com/albinsunnanbo/authservices/tree/TestFormSubmit
Note this happens only when the posted form contains multiple fields with the same name.
Stack trace;