Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: QueryStringValueProvider does not use the right culture [1592]

$
0
0
QueryStringValueProviderFactory calls QueryStringValueProvider's wrong constructor :

// For unit testing
internal QueryStringValueProvider(ControllerContext controllerContext, IUnvalidatedRequestValues unvalidatedValues)
: base(controllerContext.HttpContext.Request.QueryString, unvalidatedValues.QueryString, CultureInfo.InvariantCulture)
{
}

wich ignores the current culture.

The observed behavior is for example wrong DateTime parsing. Workarounds are to pass parameter with POST verb and so using a different ValueProvider or passing dateTime parameters as string and convert the values inside the controller.
Comments: Tested on MVC, and by just looking at webapi source code looks like the same problem : QueryStringValueProviderFactory:27 provider = new QueryStringValueProvider(actionContext, CultureInfo.InvariantCulture);

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>