Commit Graph

106 Commits

Author SHA1 Message Date
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