Age | Commit message (Collapse) | Author |
|
|
|
* upstream/master: (21 commits)
Add MaxHttpCollectionKey support
44: Updated XML docs for IDependencyScope
More Validation Performance Improvements
Incorporate code review feedback for ResultConverters
Issue 41: fix problem with Web API running in medium trust from the GAC
Perf: improve conneg accept header sorting
perf: Optimize return value validation of methods returning a non-generic Task. A direct comparison of the type to typeof(Task) is faster than analyzing if the type is generic or not.
Code review feedback from bug #26
Value Validation Performance Improvements
Added copyright headers and License.txt
Responding to customer and partner feedback re: the Anti-XSRF helpers.
Performance improvements around simple parameters from the query string. This gets about a 2x win in the case of calling get(int,int,int) in an in-memory loop.
bug fix 395547: Addressing the issue that caused stress test failure on 4.5 where 401 response message sent is received as 500 error
Remove IHttpControllerActivator.Release()
Major TaskHelpers.Iterate perf wins. Create a fast-path for Task so that synchronous tasks execute immediately and we avoid any task allocations. This reduces iteration overhead to nearly 0. Remove iteration over Task<T> since nobody used it and it's slow.
389622 - Escaping special characters in sections is not working
Revert "257966: Parameterless overload of WebPage::ExecutePageHierarchy throws" Moving fix to next iteration.
257966: Parameterless overload of WebPage::ExecutePageHierarchy throws when called.
390625: Move the System.Web.Http.HttpRequestMessageExtensions and HttpResponseMessageExtensions classes to the System.Net.Http namespace
Updating OAuth references in Microsoft.Web.WebPages.OAuth.Test to point to release version.
...
Conflicts:
src/System.Json/Extensions/JsonValueExtensions.cs
src/System.Json/JsonValueDynamicMetaObject.cs
|
|
|
|
|
|
|
|
- Reuse singleton converter instances where possible.
- Throw on null controllerContext
|
|
Fix a bug where WebAPI would cause an error for action methods returning Task<T> when running in Medium trust from the GAC.
Instead of using Expression tree compilation, use Delegate.CreateDelegate which does not have the same access violation problem.
|
|
- only sort if there are more than 1 items
- comparer fast path when comparing the same instance
|
|
A direct comparison of the type to typeof(Task) is faster than analyzing if the type is generic or not.
|
|
|
|
|
|
|
|
What's new:
- Programmatic configuration over various Anti-XSRF behaviors:
-> The name of the cookie to use.
-> Whether SSL is required.
-> Ability to provide a nonce or other "custom data".
- The exception message is now a little less cryptic. It tells you exactly what check failed (e.g. the cookie 'foo' was missing, the token was meant for a different user, etc.).
- The system tries to detect if the current identity is degenerate (e.g. authenticated but without a name) and fails safe. The exception message specifies how to resolve the problem. (This check can be suppressed via config if necessary.)
- Ability to get the cookie and form token strings directly if you want more manual control.
- Built-in support for OpenID and Azure ACS (WIF).
- For most consumers, the token size is smaller.
Breaks:
- The salt / domain / path parameters are all obsolete as error. The customer can achieve the same effect by using the <httpCookies> configuration element or calling the AntiForgery.* APIs that are string-based.
- Not compatible with MVC 1 / 2 / 3. However, this system makes it easier to recover gracefully when an old token is submitted.
CR: marcind; bradwils
SR: naziml
|
|
This gets about a 2x win in the case of calling get(int,int,int) in an in-memory loop.
Reorder the value provider factory and model binder providers to put the most common at the top.
Put TypeConverter and QueryStringProvider at the top. If we only pull from the query string (and have no misses), this avoids even invoking the other model binders or the route value provider.
Per-request caching QueryString and RouteValue providers so that we can reuse them across parameters. We shouldn't be parsing the query string for every parameter in a request.
Use array instead of IEnumerable. Avoids expensive ToList with ValueProviderFactories. No downside here and it gets about a 15% improvement in scenario.
Avoid ToList() calls in composite model binder. If we already have the array, use that.
|
|
where 401 response message sent is received as 500 error
|
|
|
|
synchronous tasks execute immediately and we avoid any task allocations. This reduces iteration overhead to nearly 0.
Remove iteration over Task<T> since nobody used it and it's slow.
Ensure that in task.Finally(), original task exception is observed even if finally clause throws.
Add some unit tests to the task finally extensions.Ensure that the exception from a finally clause is the one that propagates.
|
|
|
|
Moving fix to next iteration.
This reverts commit a565f101ffe8d28a415668cad7f558585efc0cc6.
|
|
when called.
|
|
HttpResponseMessageExtensions classes to the System.Net.Http namespace
Also move GetCorrelationId to main request extensions file.
|
|
|
|
* upstream/master: (68 commits)
Fix for test broken during prior commit rebase.
26: Separate service location from dependency injection
Update .gitattributes for .resx to merge=union
Remove MediaTypeFormatterCollection.Find() methods. They were not being used and they did not take into account whether a formatters supported a particular type.
Issue #12 Add CreateResponse<T>() overloads that accept formatter and media type parameters.
Performance improvement on validate. Cache expensive parts of the modelbinding context across requests, specifically validation nodes. Also need to ensure the cached nodes get propagated down to usage point when we clone a context.
Mark quota exceptions as Handled for Json
Setting /nr:false for build.cmd, will stop MSBUILD.exe from sticking around after builds are finished.
Fix race condition in TaskHelpersExtensions.Catch
349089: Fixing the issue where HttpMethodConstraint does not work for WebAPI on Web Host
Update DNOA packages in Microsoft.Web.WebPages.OAuth project to released version.
perf: improve TaskHelpers.Iterate. There's a huge perf penalty for switch threads on completed tasks.
[cleanup] remove empty folder from project no functional changes.
Added support for dealing with wildcard matching in accept headers by updating the comparison mechanism by which we compare two media types. The comparison now includes wild-cards as part of it matching algorithm (both "*/*" and "text/*".
Fix additional collection-related APIs to consume/return consistent types
Bug 333326: HttpControllerDispatcher should not set the controllerName on HttpControllerDescriptor based on controller route value
DevDiv 388456 -- WebHost should not use Transfer-Encoding chunked when content length is known
DevDiv bug 388519 --[Monitoring] HttpActionBindingTracer was not created, and tracing did not show the roll-up of model binding results.
Minor code clean up in cookie related classes.
Updated BufferedMediaTypeFormatter to follow the pattern defined by MediaTypeFormatterTestBase with respect to when to close the inner stream, how to handle 0 size content-length, and other constraints. At the same time allowed the common "using" pattern for reading and writing streams so that a sample formatter written on top of BufferedMediaTypeFormatter simply can do this:
...
|
|
|
|
|
|
They were not being used and they did not take into account whether a formatters supported a particular type.
|
|
type parameters.
These overloads make it easier to create a response containing an ObjectContent<T> given a particular format.
Add MediaTypeFormatterCollection.FindWriter() that also considers the value's declared type when searching for a write formatter.
|
|
modelbinding context across requests, specifically validation nodes. Also need to ensure the cached nodes get propagated down to usage point when we clone a context.
|
|
|
|
|
|
on Web Host
|
|
version.
|
|
threads on completed tasks.
|
|
updating the comparison mechanism by which we compare two media types. The comparison now includes wild-cards as part of it matching algorithm (both "*/*" and "text/*".
Changed MediaTypeHeaderEqualityComparer to become an extension method called "IsSubsetOf" on MediaTypeHeaderValue as it is not semantically a comparer but rather computes whether a mediatype is a subset of another mediatype.
Also, added extensive tests for this and other MediaTypeHeaderValueExtensions methods.
|
|
|
|
HttpControllerDescriptor based on controller route value
This commit is just fixing the cache that DefaultHttpControllerSelector
uses for ControllerDescriptors. I have opened a seperate bug 391806 to
remove the ControllerName property from HttpControllerDescriptor.
|
|
content length is known
|
|
and tracing did not show the roll-up of model binding results.
|
|
|
|
MediaTypeFormatterTestBase with respect to when to close the inner stream, how to handle 0 size content-length, and other constraints.
At the same time allowed the common "using" pattern for reading and writing streams so that a sample formatter written on top of BufferedMediaTypeFormatter simply can do this:
using (var sReader = new StreamReader(stream, encoding))
{
return sReader.ReadToEnd();
}
and
using (var sWriter = new StreamWriter(stream, encoding))
{
sWriter.Write(value);
}
This now works even with StreamReader/Writer closing the inner stream upon exiting the using statement.
Bug 389357: BufferedMediaTypeFormatter should not close the stream on Read.
|
|
outgoing media types was wrong in that it didn't set the charset parameter upon construction of the ObjectContent. This check-in fixes the previous fix by essentially reverting it and instead add the charset parameter in the ObjectContent constructor.
Also, added tests for MediaTypeFormatter.SetDefaultContentHeaders coving this and other scenarios
|
|
created corresponding filter attributes.
|
|
|
|
format instead of reading the URI directly
1) Use route data({ext}) instead of parsing the uri directly to figure out
the extension.
2) Move the type (and its tests) from System.Net.Http.Formatting to
System.Web.Http as the it depends on routing data now. Also,
UriPathExtensionMappings are not relevant on the client scenario. So,
there is no loss in functionality associated with this move.
|
|
|
|
Content is an instance of ObjectContent (bug 339345)
If the type is assignable then ReadAsAsync will fetch the value out of ObjectContent directly, avoiding the need for roundtrip serialization.
|
|
|
|
still ridiculously expensive, so reuse the completed task in the mainline case for catch and finally.
|
|
closing streams.
|
|
Change QueryStringValueProviderFactory to use the InvariantCulture when deserializing query string values.
|