Commit Graph

238 Commits

Author SHA1 Message Date
Bruno Costa dafb4d38f0 Fix documentation typo (#9740) 2019-04-25 08:43:13 -07:00
dotnet-maestro[bot] 8eb2e8baec
[master] Update dependencies from dotnet/arcade (#9715)
* Update dependencies from https://github.com/dotnet/arcade build 20190423.2

- Microsoft.DotNet.GenAPI - 1.0.0-beta.19223.2

* Adjust to GenApi change in `enum` ordering
- was sorted by name, now by value
2019-04-24 19:21:37 +00:00
Pranav K 9ac2f52b22
Specify Content-Length for buffered responses (#9699) 2019-04-24 09:57:53 -07:00
Ben Adams bae733151b Lazy create RequestServicesFeature DisposeAsync statemachine (#9512) 2019-04-22 17:21:19 -07:00
Ben Adams f4972dc6b6 Skip string.Equals in FastPathTokenizer (#9579) 2019-04-22 10:06:21 -07:00
Ben Adams 48c97b425e Use .IndexOf(char/byte) where possible (#9539) 2019-04-22 10:05:40 -07:00
David Fowler d62d33c531
Avoid allocating the CandidateSet when there's a single match (#9622)
- Add fast path for 0 route values, and policies
- Remove RVD allocation in the fast path
2019-04-21 23:33:40 -07:00
John Luo 7a040f310b
Enable Pubternal API checks (#9530)
* Enable Pubternal API checks

* Use pragma

* Convert to pragma

* Test fix

* Remove extra restore dependencies
2019-04-19 18:49:07 -07:00
Ben Adams 5ff2910d09 UriHelper use Ordinal string.IndexOf (#9537) 2019-04-19 10:14:03 -07:00
Ben Adams 23efa15112 Lazy create EndpointRouting statemachines (#9506) 2019-04-18 16:40:06 -07:00
Justin Kotalik eb41de88a9
Fix flaky routing test (#9505) 2019-04-18 13:40:43 -07:00
Ben Adams 8fcadf72cd Allow headers to match on ReferenceEquals before OrdinalIgnoreCase (#9341) 2019-04-18 12:00:01 -07:00
Pranav K 92cae6faab
Buffer writes from sources of synchronous writes (#9015)
* Buffer writes from sources of synchronous writes

Fixes https://github.com/aspnet/AspNetCore/issues/6397
2019-04-17 18:11:07 -07:00
Ryan Nowak 4f57a4af14 Address Jimmys cool feedback 2019-04-16 19:36:32 -07:00
Ryan Nowak 84916223bb Address Bens cool feedback 2019-04-16 19:36:32 -07:00
Ryan Nowak 4f015e2813 Add ability to replace an endpoint with a collection
This is a crucial enabler for dynamic scenarios. A policy can replace an
endpoint with a *group* of dynamic endpoints which will be disambiguated
by other policies.
2019-04-16 19:36:32 -07:00
Ryan Nowak e47fbbab9e Slim down CandidateSet 2019-04-16 19:36:32 -07:00
Ryan Nowak eca6a71754 Implement IEndpointSelectorPolicy for HttpMethodMatcherPolicy 2019-04-16 19:36:32 -07:00
Ryan Nowak 8df3dc7ae4 Make HostMatcherPolicy implement IEndpointSelectorPolicy 2019-04-16 19:36:32 -07:00
Ryan Nowak 94fab79771 Add some cool docs about IDynamicEndpointMetadata.
This will make James happy, which makes it more likely he will
look at the rest of the PR.
2019-04-16 19:36:32 -07:00
dotnet-maestro[bot] 039e505160
[master] Update dependencies from 2 repositories (#9411)
* Update dependencies from https://github.com/aspnet/EntityFrameworkCore build 20190415.3

- Microsoft.EntityFrameworkCore.Tools - 3.0.0-preview5.19215.3
- Microsoft.EntityFrameworkCore.SqlServer - 3.0.0-preview5.19215.3
- dotnet-ef - 3.0.0-preview5.19215.3
- Microsoft.EntityFrameworkCore - 3.0.0-preview5.19215.3
- Microsoft.EntityFrameworkCore.InMemory - 3.0.0-preview5.19215.3
- Microsoft.EntityFrameworkCore.Relational - 3.0.0-preview5.19215.3
- Microsoft.EntityFrameworkCore.Sqlite - 3.0.0-preview5.19215.3

Dependency coherency updates

- Microsoft.AspNetCore.Analyzer.Testing - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.AspNetCore.BenchmarkRunner.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.ActivatorUtilities.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Caching.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Caching.Memory - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Caching.SqlServer - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Caching.StackExchangeRedis - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.CommandLineUtils.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.AzureKeyVault - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.Binder - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.CommandLine - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.EnvironmentVariables - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.FileExtensions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.Ini - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.Json - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.KeyPerFile - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.UserSecrets - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration.Xml - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Configuration - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.DependencyInjection.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.DependencyInjection - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.DiagnosticAdapter - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Diagnostics.HealthChecks - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.FileProviders.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.FileProviders.Composite - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.FileProviders.Embedded - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.FileProviders.Physical - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.FileSystemGlobbing - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.HashCodeCombiner.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Hosting.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Hosting - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.HostFactoryResolver.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Http - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Localization.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Localization - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.Abstractions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.AzureAppServices - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.Configuration - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.Console - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.Debug - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.EventSource - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.TraceSource - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Logging.Testing - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.ObjectPool - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Options.ConfigurationExtensions - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Options.DataAnnotations - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Options - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.ParameterDefaultValue.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.Primitives - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.TypeNameHelper.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.ValueStopwatch.Sources - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.WebEncoders - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Internal.Extensions.Refs - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.JSInterop - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Mono.WebAssembly.Interop - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Bcl.Json.Sources - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.CSharp - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Win32.Registry - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.ComponentModel.Annotations - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Data.SqlClient - 4.7.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Diagnostics.EventLog - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.IO.Pipelines - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Net.Http.WinHttpHandler - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Net.WebSockets.WebSocketProtocol - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Reflection.Metadata - 1.7.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Runtime.CompilerServices.Unsafe - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Security.Cryptography.Cng - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Security.Cryptography.Pkcs - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Security.Cryptography.Xml - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Security.Permissions - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Security.Principal.Windows - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.ServiceProcess.ServiceController - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Text.Encodings.Web - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- System.Threading.Channels - 4.6.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.Extensions.DependencyModel - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.NETCore.Platforms - 3.0.0-preview5.19212.14 (parent: Microsoft.NETCore.App)
- Microsoft.NETCore.App - 3.0.0-preview5-27613-11 (parent: Microsoft.Extensions.Logging)
- Microsoft.Extensions.Logging - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Internal.AspNetCore.Analyzers - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)
- Microsoft.AspNetCore.Testing - 3.0.0-preview5.19214.1 (parent: Microsoft.EntityFrameworkCore)

* Update dependencies from https://github.com/aspnet/AspNetCore-Tooling build 20190415.3

- Microsoft.NET.Sdk.Razor - 3.0.0-preview5.19215.3
- Microsoft.CodeAnalysis.Razor - 3.0.0-preview5.19215.3
- Microsoft.AspNetCore.Razor.Language - 3.0.0-preview5.19215.3
- Microsoft.AspNetCore.Mvc.Razor.Extensions - 3.0.0-preview5.19215.3

* Patch utf8 test
2019-04-16 21:40:21 +00:00
Ryan Nowak 763720b092 Remove Routing pubternal
This change makes a bunch of random routing classes internal instead of
pubternal. Most of these have no use case and aren't valuable at all
outside of routing code.

The one exception here is that the only way to construct a
`TemplateBinder` in 1.0-2.2 is using a constructor that accepts some
pubternal types. I don't think it's a good idea to just yank this since
the usage is pretty wide.

Instead I added a factory service so you can create this, and marked the
constructor [Obsolete] where these types are touched. We can make the
actual breaking change in the next major release.
2019-04-14 14:49:17 -07:00
Ben Adams dc08a60f5e Lazy allocate dictionary in ItemsDictionary (#9284) 2019-04-14 08:09:17 -07:00
BrennanConroy 022e79cf17
Improve HeaderSplit perf (#9309) 2019-04-11 22:29:23 -07:00
Pranav K ae34697797 Fix #9041 - Complain if auth hasn't been set up correctly (#9181) 2019-04-11 10:36:21 -07:00
Justin Kotalik 0378cbbc51 Rename StreamPipeReaderOptions to StreamPipeReaderAdapterOptions (#9177) 2019-04-09 17:05:44 -07:00
Ryan Nowak 258d34e382
Use coventional routes for link generation (#9037)
Use coventional routes for link generation

This change enables using conventional routes for link generation when
using MVC conventional routes. This change makes MVC link generation
behaviour highly compatible with 2.1.

The way that this works is that we create endpoints for **MATCHING**
using the denormalized conventional route, but we tell those endpoints
to suppress link generation.

For link generation we generate a non-matching endpoints per-route with
the same order value.

I added the concept of *required value any* to link generation. This is
needed because for an endpoint to participate in link generation using
RouteValuesAddress it needs to have some required values. These details
are a little fiddly, but I think it's worth doing this feature
completely.
2019-04-05 08:31:10 -07:00
Justin Kotalik 010139ac8a
Limit chunk size when writing chunked responses (#8837) 2019-03-29 16:34:26 -07:00
Ryan Nowak 658b37d2bd
Make UseEndpoints a thing (#8765)
* Make endpoint middleware explicit

This change makes the endpoint middleware explicit again, and updates
all of the templates.

The other change here is make UseEndpoints be the place where you
register endpoints. This is vital because it puts your code visually at
the point of the pipeline where it executes.

Lastly, I removed support for UseMvc with endpoint routing. This is
causing issues for some security features, and we're moving in the
direction of trying to make the middleware heavy implementation required
in 3.0. There are some issues we won't be able to fix in MVC if we can't
unambiguously know if UseMvc was used or the middleware.
2019-03-28 15:41:11 -07:00
Ryan Nowak 0dc14a61ce Simplify Map methods 2019-03-13 20:12:53 -07:00
Ryan Nowak 4b4614635f Change template -> pattern for MVC 2019-03-13 20:12:53 -07:00
Ryan Nowak e78a6521b9 Make naming of IEndpointRouteBuilderConsistent across usages. 2019-03-13 20:12:53 -07:00
Chris Ross 6db129a588
Support conditional compression #6925 (#8239) 2019-03-07 11:09:48 -08:00
Ryan Nowak a1ec03e1e6 Add fallback routing for controllers and pages 2019-03-06 09:48:07 -08:00
Ryan Nowak bb28db6fb2 Generalize Action Selection logic
Allows us to use the "select action via route values" logic for
endpoints.
2019-03-06 09:48:07 -08:00
Ryan Nowak f150e89125 Add file/non-file and generic fallback
Adds new constraints for checking if a route value is a file or not.

Added a new set of builder methods that specify what it means to be a
'fallback'. This is really similar to what the older SPA fallback routes
do, but this is lower in the stack and directly integrated with
endpoints.
2019-03-06 09:48:07 -08:00
David Fowler 4c79e7fdc0
Rename Pipe properties (#8227)
* Rename Pipe properties
- Rename BodyPipe to BodyReader and BodyWriter on the request and response directly
2019-03-06 07:33:24 -08:00
Chris Ross 93b195e566
Change SameSite default to None #2675 #4661 (#8043) 2019-03-01 16:22:12 -08:00
Justin Kotalik fc9e48877c
Add FormPipeReader (#7964) 2019-03-01 14:41:05 -08:00
Justin Kotalik 5fd53d9d07
Check HasStarted before calling Flush/Start in StartAsync (#8041) 2019-02-28 22:45:24 -08:00
Justin Kotalik 3509323ad1
Remove extra await/state machine in FlushAsync (#7646) 2019-02-28 22:42:42 -08:00
Nathan 4e4fdaaf68 Adding SameSite comments (#7907) 2019-02-27 12:00:16 -08:00
Nate McMaster 7fe3b7640d
Merge branch 'release/3.0-preview3' 2019-02-22 15:07:50 -08:00
Ryan Nowak 3d448f7197 Fix #5055 use of page parameter (#7441)
This change introduces some new heuristics to make it easier to use
'page' or other resevered parameter names as parameters in URL
generation.

--

The main change here is to allow the link generation tree to *ignore* a
value passed in to URL generation when it conflicts with an endpoint's
required values.

The main concern of this feature area is "how do we tell whether you are
linking to an action or a page?". Routing attempts to do the right thing
will requiring very little from the user in terms of expressing intent.

In this case, we try to tell the difference between an attempt to generate
a link to an action due to the presence of the 'action' parameter and
absence of the 'page' parameter. This obviously doesn't work when you
want to use 'page' as a non-reserved parameter in an action. The same
case occurs for pages, but users are already used to the idea that
'action' is a reserved word in MVC.

We can loosen this restriction when the value that's supplied for 'page'
is known not to be any existing value of the 'page' route value.

This approach seems somewhat reasonable but has many of the problems inherent
to this area. When it fails (the value you want to use for 'page' causes
a conflict) - it's going to be esoteric and hard to understand.
2019-02-22 11:44:43 -08:00
Pavel Krymets 9355c7c1a5
Add reference assemblies support (#7764) 2019-02-21 14:33:35 -08:00
JulijaRamoskiene e5f4400257 FormFeature -Added exception for invalid content-disposition header (#7525) 2019-02-21 09:38:06 -08:00
Nate McMaster 9a2db43848
Follow-up to VS2019 conversion (#7753)
* Set VS version in file to 16.0.0.0
* Fix for restore failure on Microsoft.AspNetCore.App.Runtime.csproj
2019-02-20 11:02:38 -08:00
Nate McMaster 85ae18c723
Make Visual Studio 2019 a prerequisite to building this repo (#7005)
Changes:

* Make Visual Studio 2019 a prerequisite for building this repo
* Update .sln files
* Update Windows SDK to 17134
* Update developer docs
* Disable ANCM tests
* Update to .NET Core SDK 3.0 Preview 2
* Use Microsoft.NET.Sdk.Razor as a package consistently accross the repo
* React to changes in metadata from Microsoft.NETCore.App
* React to changes in .NET Core SDK
* Attempt to workaround CodeCheck.ps1 failure which doesn't repro locally or on different agents. Possibly due to differences in the version of the PowerShell task?
* Remove dead YML file
* Rename usages of win7-{x64,x86} to win-{x64,x86}
* Update KoreBuild to 3.0.0-build-20190219.1
2019-02-20 09:53:53 -08:00
James Newton-King cc7b35439c
Add test for HTTP method metadata order (#7225) 2019-02-18 09:20:12 +13:00
Ben Adams 4646ed5618 Work around WriteBarrier assign for nulling struct (#7659) 2019-02-16 20:09:39 -08:00
James Newton-King c2d1ab925e
Remove obsolete APIs from routing (#7371) 2019-02-16 18:37:51 +13:00
Justin Kotalik 60b00fa007
Make reads that return canceled ReadResult throw (#7618) 2019-02-15 16:11:57 -08:00
Ryan Nowak f2a1a4542e
Introduce dynamic endpoints and fix #7011 (#7445)
* Add IDynamicEndpointMetadata for dynamic endpoints

* Use a dynamic endpoint policy for pages
2019-02-13 18:52:07 -08:00
Nate McMaster 338de4710a
Automatically set 'PrivateAssets=All' for .Sources references (#7539)
When a `<Reference>` is named `*.Sources`, set PrivateAssets=All (exclude from generated nuspec) and IncludeAssets=ContentFiles (only consume content files, not .dll's)
2019-02-13 14:31:15 -08:00
Nate McMaster 3fd8a97af2
Add targets to generate the list of shared framework assemblies from project property (#7510)
Changes:
* Add support for a property, `IsAspNetCoreApp`, in the .csproj file of assemblies which are part of the shared framework. 
* Remove unused dependencies
* Remove reference which have become part of 'netcoreapp3.0'
2019-02-12 23:00:19 -08:00
David Fowler c1bc210e8e
Fix returning buffered data after stream is drained (#7476)
- Change TryRead to return the buffer if the Stream is completed
2019-02-11 20:45:15 -08:00
Ryan Nowak 5a291d0bc0 Fix #4212 area ambient value page->controller
This change enhances our ambient value logic to also deal with required
values. In 2.2 we introduced a 'required values' semantic to allow route
values to appear "to the left" of a route pattern for the purpose of
ambient values copying. This is a complicated way of saying "when you
like to a different endpoint then discard the ambient values".

What we didn't consider is that some ambient values are special (like
area). So basically, we'll allow an ambient value to be used if it's
part of the required values - even if we've already decided to discard
the ambient values.

This is a pretty surgical fix and only affected the desired scenario
based on tests.

-----

I also removed an optimization that I think is broken. I put an earlier
optimization in place that attempted to count ambient values as they
were "seen" to try and avoid some extra copying. This copying loop has a
cost even if it no-ops which is what I was trying to prevent.

Unfortunately since we added 'required values' - it's now possible for
an ambient value to be double-counted, which makes this optimization
incorrect.
2019-02-11 15:58:33 -08:00
David Fowler 476a1827f4
Made changes to stream <-> pipe adapters (#7407)
- Use the array pool by default when the shared memory pool is specified for both the StreamPipeReader and StreamPipeWriter
- Support allocating unpooled memory if the StreamPipeWriter is asked for memory outside of the max pool size
2019-02-11 11:15:36 -08:00
Joni 9e06cfb7f8 Fix typo in HttpResponseWritingExtensions (#7413)
Fix typo WriteMutliSegmentEncoded => WriteMultiSegmentEncoded
2019-02-09 08:14:11 -08:00
Justin Kotalik 35b99e44ce
Expose HttpResponse PipeWriter in Kestrel (#7110) 2019-02-08 17:24:26 -08:00
Justin Kotalik e3d0dc0a96
Try re-enabling CancellationToken tests for StreamAdapters (#6755) 2019-02-08 10:10:38 -08:00
Justin Kotalik 9e5f09cb44
Make Dispose not throw in StreamPipeWriter (#7376) 2019-02-08 08:44:34 -08:00
Justin Kotalik 3bd5f2c2ab
Return Completed ReadResult after stream returns 0 bytes (#7337) 2019-02-08 08:44:09 -08:00
Hao Kung c9499e14e4
Run helix tests on master (#6728) 2019-02-07 09:20:08 -08:00
Pavel Krymets b21c09665e
Add DisposeAsync support to WebHost and RequestServices (#7091) 2019-02-05 15:42:41 -08:00
Justin Kotalik 9251dfe7c0
Make GetMemory use MaxBufferSize for MemoryPool (#7143) 2019-02-04 13:55:48 -08:00
David Fowler 9f202feafc
Rename IHttpContextContainer to IDefaultHttpContextContainer (#7217)
- Renamed since the property has to be a DefaultHttpContext
2019-02-02 22:31:49 -08:00
David Fowler f3072339de
Handle null attributes in generated delegates (#7210) 2019-02-02 06:18:54 -08:00
Gérald Barré f1b24ccb92 Replace unsafe code with string.Create for hex generation (#6784) 2019-02-01 10:06:20 -08:00
James Newton-King 574be0d22c
Add readonly modifier to readonly structs (#7169) 2019-02-01 15:04:25 +13:00
Justin Kotalik 7d21ee1a5a
Call Slice in GetMemory (#7113) 2019-01-30 14:26:56 -08:00
Justin Kotalik 8f51dd35ce
Make StreamPipeWriter.Complete throw if there is unflushed data (#7115) 2019-01-30 11:22:53 -08:00
James Newton-King 820ea09fdd
Add routing function test with convention builder (#6829) 2019-01-30 09:53:34 +13:00
Justin Kotalik 1222d8de49
Add StartAsync() to HttpResponse; ImplementFeature in Kestrel (#6967) 2019-01-28 17:42:04 -08:00
David Fowler 9f71e60283
Hoist method attributes from the request delegate as metadata. (#6911)
- This should allow a more declarative approach to declaring endpoint metadata using the default methods.
- Attributes are applied first and can be overridden imperatively
2019-01-28 20:38:49 +00:00
David Fowler 14d8e33a93
Remove .Start from BufferSegment (#6832) 2019-01-28 20:37:25 +00:00
Nate McMaster 922512a9fb
Convert the artifacts folder layout to match Arcade (#6850)
Changes:
* IsProductPackage => IsShippingPackage
* artifacts/$config/packages => artifacts/packages/$config
* packages/product => packages/Shipping
* packages/internal => packages/NonShipping
* Renamed MSBuild properties used for output folders
* Update build tools to use 2 spaces in global.json
2019-01-18 13:38:24 -08:00
Nate McMaster 53682c0548
Merge branch 'release/2.2' 2019-01-17 11:01:12 -08:00
James Newton-King 133a7e0414
Add XML docs to endpoint route builder and extensions (#6700) 2019-01-18 07:23:47 +13:00
Justin Kotalik dabd3463ba few extra conflicts 2019-01-16 14:46:39 -08:00
Justin Kotalik e6d547a923 Merge branch 'jkotalik/22temp' into jkotalik/masterMerge 2019-01-16 14:39:10 -08:00
Ryan Nowak 3e5b37f22c Fix #6102 - Intense CPU utilization on page change (#6542)
* Fix #6102 - Intense CPU utilization on page change

The issue here was that every time a Razor Page changed, we would
subscribe an additional time to the endpoint change notifications. This
means that if you tweaked a page 30 times, we would update the address
table 31 times when you save the file. If you were doing a lot of editing
then this would grow to a really large amount of computation.

The fix is to use DataSourceDependentCache, which is an existing utility
type we developed for this purpose. I'm not sure why it wasn't being
used for this already. We're already using DataSourceDependentCache in a
bunch of other places, and it's well tested.

I also tweaked the stucture of this code to be more similar to
EndpointNameAddressScheme. This involved some test changes that all
seemed like good cleanup. The way this was being tested was a little
wonky.

(cherry picked from commit a5658a8c95)
2019-01-15 16:55:27 -08:00
James Newton-King cd308e7a8b
Fix HttpContext not being passed to constraints in link generation (#6644) 2019-01-16 12:00:57 +13:00
Justin Kotalik cdd38d70cf
Implement Stream Adapters (and minor nitpics) (#6583) 2019-01-15 09:00:06 -08:00
John Luo 38c0d5a50c
Use object indirection in HttpContextAccessor (#1066) (#6036) 2019-01-14 20:31:36 -08:00
Ryan Nowak a5658a8c95
Fix #6102 - Intense CPU utilization on page change (#6542)
* Fix #6102 - Intense CPU utilization on page change

The issue here was that every time a Razor Page changed, we would
subscribe an additional time to the endpoint change notifications. This
means that if you tweaked a page 30 times, we would update the address
table 31 times when you save the file. If you were doing a lot of editing
then this would grow to a really large amount of computation.

The fix is to use DataSourceDependentCache, which is an existing utility
type we developed for this purpose. I'm not sure why it wasn't being
used for this already. We're already using DataSourceDependentCache in a
bunch of other places, and it's well tested.

I also tweaked the stucture of this code to be more similar to
EndpointNameAddressScheme. This involved some test changes that all
seemed like good cleanup. The way this was being tested was a little
wonky.
2019-01-13 21:03:26 -08:00
James Newton-King accbcebac0
Support multiple policies for a key with RoutePatternFactory.Pattern (#6593) 2019-01-12 16:00:42 +13:00
James Newton-King 90511e6039
Add HostPolicyMatcher (#6214) 2019-01-11 10:46:09 +13:00
Dávid Kaya 36529e4a34 Removed extra curly bracket (#6558) (#6559) 2019-01-10 10:06:54 -08:00
David Fowler c458fe6ebe
Move request servies feature into DefaultHttpContext (#6541)
- This completely removes the per request allocation until the feature is used.
- In order to make this change viable, we need to introduce a new HttpContextFactory that can accept new services without adding 2^n constructors. As a result, this change introduces a DefaultHttpContextFactory that takes an IServiceProvider and resolves dependencies based on the needs of the DefaultHttpContext and features.
- Throw in the older HttpContextFactory constructor when the IServiceScopeFactory is null
- It also saves us from revving the feature collection version unnecessarily.
2019-01-10 09:54:09 -08:00
Nate McMaster 22f3166fa6
Merge branch 'release/2.1' into release/2.2 2019-01-10 01:22:10 -08:00
Nate McMaster 0f65d44482
Merge branch 'release/2.2' 2019-01-09 18:09:25 -08:00
Hao Kung d7a7c65b2b
Remove old 1.x auth stack (#4485)
* Remove old 1.x auth stack

Fixes https://github.com/aspnet/AspNetCore/issues/3999
2019-01-09 15:56:19 -08:00
Nate McMaster a3f9b74bb9
Merge branch 'release/2.1' into release/2.2 2019-01-09 14:52:53 -08:00
David Fowler ea344bf726
Don't allocate the FormFeature eagerly (#6511)
- Expose FormOptions on DefaultHttpContext
- Use those options on DefaultHttpContext when the FormFeature is initialized
2019-01-09 14:44:41 -08:00
David Fowler a11c68ae35
Remove all extensibility from the DefaultHttpContext (#6504)
- Seal all of the classes
- Remove virtual methods
- Delete pooled HttpContext code
- Removed obsolete AuthenticationManager
2019-01-09 11:37:06 -08:00
Justin Kotalik 5541a7a026
Implement PipeBody Features and add to HttpContext (#6394) 2019-01-08 21:31:50 -08:00
David Fowler 688ad19170
Reuse HttpContext object per HTTP/1 connection and HTTP/2 stream (#6424)
- Today in Kestrel, we reuse the IFeatureCollection per connection and per Http2Stream. This PR aims to take advantage of that same technique and affinitize the HttpContext and friends so that they are only allocated per connection.
- ReusableHttpContext and friends mimic the functionality of DefaultHttpContext but is sealed and has no overridable methods.
- Introduce IHttpContextContainer which allows servers to cache the HttpContext and friends across requests.
2019-01-08 16:54:46 -08:00
James Newton-King aadbed62de
Add event name in routing (#6455) 2019-01-09 12:01:14 +13:00
David Fowler d116ab8550
Remove ObjectPoolProvider from default set of hosting services (#6437)
- Added it where it was being used
- Updated tests
2019-01-08 12:05:48 -08:00
Nate McMaster 5d16f97965
Remove netcoreapp2.0 test TFMs (#6461)
.NET Core 2.0 reached EOL last year. This removes multi-targeting our test projects and test assets to only use .NET Core 2.1 and .NET Framework 4.6.1.
2019-01-08 11:20:09 -08:00
Martin Costello ca7c48c520 Fix ArgumentException from duplicate key (#6416) 2019-01-07 13:42:36 +13:00
Justin Kotalik 3c04338891
Move PipeAdapters to System.IO.Pipelines namespace. (#6325) 2019-01-03 15:58:59 -08:00
Justin Kotalik 910e5ad7e5
Reference InprocessTestSite in CreateDefaultBuilderApp and Disable Failing Tests (#6318) 2019-01-03 08:54:14 -08:00
Pavel Krymets 0ae6cc8e88
Remove InplaceStringBuilder usages (#6163) 2019-01-02 15:50:19 -08:00
Pranav K 94dd5eff21 Fix incorrect Debug.Assert statements 2019-01-02 14:13:46 -08:00
Kristian Hellang a25c7d95e3 Replace custom DateTimeFormatter with ToString("r") or TryFormat (#5695) 2018-12-28 10:01:34 -08:00
James Newton-King 28cf059a3d
Sort endpoint pattern with OrdinalIgnoreCase (#6059) 2018-12-21 10:47:37 +13:00
James Newton-King dbf1dca723
Fix HttpContext not being passed to constraints in link generation (#6045) 2018-12-21 10:19:03 +13:00
James Newton-King 4b12d917ae
Merge branch 'release/2.2' 2018-12-21 07:57:52 +13:00
James Newton-King 4601a26ec2
Fix order in DFA matcher test (#5954) 2018-12-21 07:33:54 +13:00
Nate McMaster 335c9be7b4
Update the artifacts directory organization and simplify publishing targets (#5701)
This simplifies the way that we publish files to our network drop share.

Changes:
* Instead of explicitly listing every file that needs to publish, use directories to classify packages and artifacts into different categories.
* Add documentation for the expected layout of artifacts/
* Remove the need for static analysis to determine which packages go to which project
* Add the MSBuild property "IsProductPackage" to .csproj files which ship as a package to NuGet.org.
2018-12-18 11:40:13 -08:00
Nate McMaster 0cd79cc4c1
Remove unused VS dependencies and old versions of .NET Core from dependencies (#5317)
As a result of removing Razor's VS projects and upgrading all projects to netcoreapp3.0, we no longer need dependency variable for .NET Core 1.x and 2.x and Visual Studio packages.

Changes:
* Remove 'StandardTestTfm'
* Remove variables for .NET Core 1.0, 1.1, 2.0, 2.1, and 2.2
* Remove VSIX variables
* Stop generating 'branding.props' - this hasn't been used in a while and is no longer needed
2018-12-17 16:28:33 -08:00
James Newton-King cc899e2be7
Move EndpointModel and IEndpointConventionBuilder to HTTP abstractions (#4274) 2018-12-17 18:38:49 +13:00
Nate McMaster 02780bac26
Merge branch 'release/2.2' 2018-12-14 16:03:16 -08:00
Nate McMaster feb641ddda
Merge branch 'release/2.1' into release/2.2 2018-12-14 09:44:15 -08:00
Chris Ross 54c1122582
Change HTTP projects to target netcoreapp3.0 #3754 (#4625) 2018-12-14 09:36:57 -08:00
Nate McMaster 13ae0057fb
Replace .Sources package references with local code (#4801)
Replaces package references the following packages with local code:

Microsoft.AspNetCore.Certificates.Generation.Sources
Microsoft.Extensions.CopyOnWriteDictionary.Sources 
Microsoft.Extensions.ClosedGenericMatcher.Sources
Microsoft.Extensions.ObjectMethodExecutor.Sources
Microsoft.Extensions.PropertyActivator.Sources
Microsoft.Extensions.PropertyHelper.Sources
Microsoft.Extensions.RazorViews.Sources
Microsoft.Extensions.SecurityHelper.Sources
Microsoft.Extensions.StackTrace.Sources
Microsoft.Extensions.WebEncoders.Sources
2018-12-14 08:36:36 -08:00
James Newton-King ac1b5c58b0
Fix NU1105 errors in HttpAbstractions.sln (#4608) 2018-12-13 10:15:01 +13:00
Justin Kotalik 226f2c0c2c
Adds MinimumReadThreshold to StreamPipeReader. (#4372) 2018-12-12 13:09:15 -05:00
Nate McMaster d12827e609
Merge branch 'release/2.2' 2018-12-11 18:04:58 -08:00
dotnet-maestro-bot 38785d0be9 [automated] Merge branch 'release/2.1' => 'release/2.2' (#4577)
* Workaround problems when opening solution files in Visual Studio (#4569)

Changes:

* Condense Routing.sln into HttpAbstractions.sln
* Workaround NU1105 by adding all ProjectReferences to the .sln
* Workaround exceptions in the ReferencesHostBridge by moving Reference items to a temporary item group
* Add a 'startvs.cmd' script for launching VS with the right env variables
* Remove RangeHelper test project
* Move RangeHelper tests into StaticFiles.Tests and add target for NPM restore

* Convert Session to use Reference and move to Middleware folder (#4576)

* Add RoutingSample.Web to HttpAbstractions.sln
2018-12-11 16:13:20 -08:00
Nate McMaster 719ff08409
Add RoutingSample.Web to HttpAbstractions.sln 2018-12-11 14:58:05 -08:00
Nate McMaster 5151e7b1ed
Workaround problems when opening solution files in Visual Studio (#4569)
Changes:

* Condense Routing.sln into HttpAbstractions.sln
* Workaround NU1105 by adding all ProjectReferences to the .sln
* Workaround exceptions in the ReferencesHostBridge by moving Reference items to a temporary item group
* Add a 'startvs.cmd' script for launching VS with the right env variables
* Remove RangeHelper test project
* Move RangeHelper tests into StaticFiles.Tests and add target for NPM restore
2018-12-11 14:05:21 -08:00
Ryan Nowak 61d33bed27 Fix failing routing tests 2018-12-10 17:17:58 -08:00
Tornike Kharaishvili d73d95f1d4 CookieSecurePolicy documentation update (#3670) (#4542) 2018-12-09 20:29:40 -08:00
Nate McMaster 85e2147ff0
Merge branch 'release/2.2' 2018-12-07 11:11:44 -08:00
Nate McMaster 569a14ecb8
Merge branch 'release/2.1' into release/2.2 2018-12-06 17:09:03 -08:00
Nate McMaster 5c2a701b38
Remove conditional targetframeworks from routing projects (#4476) 2018-12-06 12:21:05 -08:00
Nate McMaster 50bea05918
Refactor Routing to use ProjectReference and move into src/Http folder (#4441)
Changes:

* Stop producing Microsoft.AspNetCore.Routing.DecisionTree.Sources. I could not find any usages outside of the Microsoft.AspNetCore.Routing assembly, so I've moved this to be a subfolder of code in the Microsoft.AspNetCore.Routing project.
* Stop building src/Routing as a submodule. Use ProjectReference instead
* Move projects from src/Routing into src/Http/Routing/ and src/Http/Routing.Abstractions/
* Update package baselines and dependencies to support building routing projects and samples
2018-12-05 22:14:22 -08:00
Justin Kotalik e9c4c935f6
Remove FlushResultCancellationTests as it isn't relevant (#4435) 2018-12-05 12:05:05 -08:00
Justin Kotalik c06a06d16b
Add StreamPipeReader (#4182) 2018-11-30 09:55:45 -08:00
Nate McMaster ee1e2d6173
Merge the master branch of aspnet/HttpAbstractions 2018-11-20 09:49:01 -08:00
Nate McMaster 0f64aa5c01
Merge aspnet/HttpAbstractions release/2.2 2018-11-20 09:15:59 -08:00
Nate McMaster c199b7a658
Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in bc7092a32b
2018-11-20 08:45:03 -08:00
Nate McMaster 0063d5a031
Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in 91db78cf92
2018-11-20 08:37:32 -08:00
Nate McMaster 4fcc8b9902
Update targets to build HttpAbstractions projects 2018-11-19 21:34:26 -08:00
Nate McMaster 0ef9993f46
Reorganize source code in preparation to move into aspnet/AspNetCore
Prior to reorganization, this source code was found in d142d58eb4
2018-11-19 21:12:01 -08:00