Commit Graph

1564 Commits

Author SHA1 Message Date
ryanbrandenburg cad7d44686 * Add a sample for SubAreas 2016-01-12 11:48:09 -08:00
N. Taylor Mullen 947d070678 Skip TagHelperSample index test due to mono encoding bug.
Due to aspnet/External#50.
2016-01-12 10:13:47 -08:00
N. Taylor Mullen dbb69ef952 Add `TagHelperSample.Web` functional tests.
- Validated that each of `TagHelperSample.Web`s sites work properly.
- Found that the `ConditionalCommentTagHelper` page wasn't working as intended due to never being updated after `TagHelperContent` encoding changes.
- Added content verification for the `TagHelper/ConditionalComment` endpoint only since it's static HTML.

#3530
2016-01-11 17:12:47 -08:00
John Luo c8a59d7f3e Reacting to new middleware options pattern 2016-01-08 18:07:36 -08:00
Ryan Nowak 2eb6cd655b Write our ViewBuffer values asynchronously 2016-01-08 17:12:27 -08:00
Pavel Krymets 57bf12311b Revert DependencyContext changes untill dotnet-cli packages get sorted out 2016-01-08 15:59:53 -08:00
Pavel Krymets 566790577d Add dependency context fallback to razor view compilation 2016-01-08 13:43:52 -08:00
Ajay Bhargav Baaskaran 0bb772a815 [Fixes #3755] Added logging for view compilation 2016-01-08 11:58:09 -08:00
John Luo c68f742dd0 Disabling hanging FlushPoint test 2016-01-08 11:56:31 -08:00
Ajay Bhargav Baaskaran bf1fcf6b56 Return BadRequest response when antiforgery token validation fails 2016-01-08 10:35:00 -08:00
John Luo 8afe28c05d Updating tests to add options to services 2016-01-07 23:54:55 -08:00
Ryan Nowak c304984a8d Fix #3501 - Issues with Flush
Calling Flush[Async]() on the writer will NOT flush the stream.
Calling Flush[Async]() in Razor will flush both the writer and the stream.

Our normal flow will be to flush the writer, but not the stream. This
avoids chunking, but allows us to do a WriteAsync on the stream as part of
the call to FlushAsync. This is done to avoid a synchronous write due to
Dispose calling Flush on the writer, which needs to call Write on the
stream.

See issue for extensive background.
2016-01-07 14:52:22 -08:00
Ryan Nowak 676bde29b9 Make Begin[Route]Form include antiforgery 2016-01-07 13:24:01 -08:00
N. Taylor Mullen 2b83dbb52e Make `ExpressionRewriter` more resilient to unconvertible types.
#3825
2016-01-07 11:41:14 -08:00
Pranav K dc878f2777 Capture exceptions thrown during compilation
Fixes #3870
2016-01-07 11:21:45 -08:00
Ryan Nowak ff00c07b85 Rename ActionDescriptorsCollection
ActionDescriptorsCollection -> ActionDescriptorCollection
2016-01-07 10:26:12 -08:00
Pranav K 9168cd1f37 Optimize allocations in Script/Link TagHelpers
Fixes #3618
2016-01-07 09:56:24 -08:00
Ryan Nowak a500a93dfb Smarter antiforgery
Adds the concept of an IAntiforgeryPolicy marker interface as well as
the ability to overide policy with a 'closer' filter.

Adds a new [IgnoreAntiforgeryToken] attribute for overriding a scoped
antiforgery policy.

Adds a new [AutoValidateAntiforgeryToken] attribute (good name tbd) for
applying an application-wide antiforgery token. The idea is that you can
configure this as a global filter if your site is acting as a pure
browser-based or 1st party SPA. This new attribute only validates the
token for unsafe HTTP methods, so you can apply it broadly.
2016-01-05 17:24:33 -08:00
Pranav K 0a2b6205c9 Reacting to Routing changes 2016-01-05 12:05:20 -08:00
Ryan Nowak 4141fcae69 Optimize MvcRouteHandler
- Check MVC services once at startup
- Make action selector sync

We've never really had a scenario for the action selector being async, it
just ended up that way. None of our extensibility here lets you do
anything async without replacing it wholesale, which we don't
recommend.
2016-01-05 11:31:43 -08:00
Ajay Bhargav Baaskaran 47a3aee2c1 [Fixes #3361] Changed the value provider preference to be backwards compatible 2016-01-04 12:55:35 -08:00
Ajay Bhargav Baaskaran 1f87442092 [Fixes #3749] Expose ActionContext on IUrlHelper 2016-01-04 10:33:42 -08:00
Doug Bunting 568b061441 Mock `HttpContext`, not `DefaultHttpContext`
- build break
- recent HttpAbstractions changes made `DefaultHttpContext` harder to mock (would need `CallBase=true`)
2016-01-03 14:25:42 -08:00
Pranav K 7d5a68b9ae Reacting to IHtmlContentBuilder changes 2015-12-31 11:52:26 -08:00
Ryan Nowak 51564d04c0 Remove a test that tests Dictionary
This test is coupled to Dictionary<>'s error message. We don't need this.
2015-12-30 16:55:51 -08:00
Kiran Challa 7a955bcbc0 FormatFilter overrides content type set explicitly by the developer 2015-12-30 13:20:56 -08:00
Pranav K aab051a20f Rename DictionaryBasedValueProvider to RouteValueProvider
Fixes #3629
2015-12-29 18:51:47 -08:00
Pranav K 2b9dd76535 Make RazorViewEngineOptions.FileProvider a list instead of a single item
Fixes #3806
2015-12-29 14:47:15 -08:00
Ryan Nowak d222900662 Optimize allocations in argument binder
This change avoids a state machine allocation and a dictionary allocation
on the common case (no bound properties). Ugly? You bet. Worth it? Yeah,
seems worthwhile.

This is worth about 200 bytes/request - about 3% of allocated bytes in a
smallish API scenario.
2015-12-29 09:26:59 -08:00
Ryan Nowak 0a9804056e Use System.Buffers for JSON.NET 2015-12-29 08:26:55 -08:00
Ryan Nowak 85a4c7edc5 React to changes in routing 2015-12-28 10:15:50 -08:00
Pranav K 43226fe54d Modify FileVersionProvider to cache missing file info.
Fixes #3765
2015-12-23 14:32:39 -08:00
John Luo b7d95d813d Reacting to middleware configureOptions updates 2015-12-23 12:27:57 -08:00
Pranav K 399e516065 Modify IViewComponentHelper to remove method selection ambiguity.
Fixes #612
2015-12-23 10:02:51 -08:00
damianedwards ce0e35ff75 Make ViewLocalizer base name generation more efficient:
- Because @pranavkm made me do it
- And it is actually faster and less allocating than the old code (~25% faster)
- Added some more test cases
2015-12-21 16:25:35 -08:00
Hao Kung 9364f896b3 Options renames for functionals 2015-12-21 16:18:22 -08:00
Hao Kung 0e8113e393 OptionsModel => Options rename 2015-12-21 15:00:31 -08:00
damianedwards 1529c868f2 Improve ViewLocalizer resource look-up semantics:
- Always prepend with application name and let underlying `IStringLocalizerFactory` do the name gymnastics
- Use ExecutingFilePath instead of view name
- Trim off the file extension (so your resource doesn't have to have ".cshtml" in its name)
- Improved doc comments
- Added tests to cover ViewLocalizer behavior
- #3718
- #2767
2015-12-21 14:22:32 -08:00
Kiran Challa d77655fb73 MVC Controller Response - Wrong ContentType #3245 2015-12-21 11:25:45 -08:00
Pranav K f56cf97805 Simplifying MvcTestFixture 2015-12-19 21:57:51 -08:00
N. Taylor Mullen 00722ce91a Remove `FilesWebSite` webroot. 2015-12-18 16:04:22 -08:00
Pranav K 7dac5c711b Reacting to Hosting changes 2015-12-18 15:59:42 -08:00
N. Taylor Mullen aa7ebb343a Update half of the test websites to use new Hosting API conventions.
https://github.com/aspnet/KestrelHttpServer/pull/496
2015-12-18 15:35:13 -08:00
Ryan Nowak 8fb187bf09 Use system.buffers for our reader/writer 2015-12-18 09:27:36 -08:00
Pranav K 5f66403248 Remove TextWriter.ToString from RazorPage
Fixes #3668
2015-12-18 09:12:28 -08:00
Pranav K c5b6efd6bf Move buffer types to ViewFeatures
Use buffer pooling in more places
2015-12-17 21:05:18 -08:00
damianedwards 0c3e7b5a75 Improve usability of IHtmlLocalizer & associated API:
- IHtmlLocalizer no longer derives from IStringLocalizer
- IHtmlLocalizer indexer now returns LocalizedHtmlString
- IHtmlLocalizer has GetString methods now that act the same as IStringLocalizer.GetString
- Made LocalizedHtmlString a struct to match LocalizedString
- Updated samples in response to aspnet/Localization#167
- Rename "ancestor" to "parent" for loc API
- Fixes some doc comments
- Fixed tests
- #3716
2015-12-17 16:35:19 -08:00
Pranav K a036ff4738 Reacting to DI changes 2015-12-17 12:03:29 -08:00
ryanbrandenburg 70f9431e7f * Fix test failure 2015-12-16 17:21:25 -08:00
ryanbrandenburg 6a16681ed4 * Replace MvcMinimalSample with functional test 2015-12-16 15:18:25 -08:00