Commit Graph

32 Commits

Author SHA1 Message Date
Justin Kotalik 367717760b
Handle subtype with suffix being a subtype without a suffix (#8170) 2018-07-30 12:05:41 -07:00
Pranav K e1eaf6a6e0
Cleanup TestCommon 2018-05-18 10:45:57 -07:00
Artak Mkrtchyan 7a13eb8b21 Addressed review feedback 2018-02-01 14:44:06 -08:00
Artak Mkrtchyan dea3eb7856 Not instantiating the RequestHeaders and not relying on TypedHeaders to parse AcceptCharset 2018-01-31 17:20:29 -08:00
Kiran Challa c8cabde1f1 Improve logging - individual filters 2017-12-18 13:16:06 -08:00
Pranav K 41efa409a4 Remove TestOptionsManager 2017-10-30 17:49:15 -07:00
Nate McMaster 3a710c3d64 Upgrade to xunit 2.3.0-beta4 2017-08-17 10:45:03 -07:00
Henk Mollema 948982ebff Create custom collection for model binder providers
Fixes #6161
2017-06-30 15:44:07 -07:00
Nate McMaster d70bfdd1ea Upgrade test framework versions and fix test issues 2017-05-15 14:11:27 -07:00
Steve Sanderson 90acd055fe Make [FromBody] treat empty request bodies as invalid (#4750) 2017-04-10 16:55:14 +01:00
Steve Sanderson 4f351bd37c Add support for media type suffixes (#5273, #6032) 2017-03-31 10:20:43 +01:00
Doug Bunting 9b3b3e91bd Re-enable functional tests on full .NET Framework
- #5873
- creating an EXE for the test project seems to work around #5873
  - also avoids dotnet/sdk#926 when building in Visual Studio

nit: clean up duplicate test data
2017-03-01 23:08:46 -08:00
Kiran Challa 8ac6b6699f [Fixes #4945] Simple string returned by controller action is not a valid JSON! 2017-01-25 13:29:18 -08:00
Ryan Brandenburg 6396e14504 Add null-check back to MediaType 2017-01-18 16:56:08 -08:00
Ryan Brandenburg 93774a0234 Mitigate MediaType overflow 2017-01-13 12:51:19 -08:00
Doug Bunting f04286562e Treat `ContentType==null` and `MediaType.GetEncoding(ContentType)==null` differently
- now, if client sends e.g. `Content-type: text/json;charset=[invalid]`, service will respond with HTTP/415
 - if client sends `Content-type: text/json`, service will still try UTF-8 (or updated default encoding)
 - intentional (and slight) behaviour change from 1ac7315
- include and a few new tests and some cleanup from same commit
2016-11-03 10:51:39 -07:00
Doug Bunting 116c927e61 Revert "Do not call `Encoding.GetEncoding()` with a string from the request"
- #5351 should be Won't Fix

This reverts commit 1ac731519a.
2016-11-03 10:51:39 -07:00
Doug Bunting 1ac731519a Do not call `Encoding.GetEncoding()` with a string from the request
- #5351
- fix affects only `TextInputFormatter`
 - `TextOutputFormatter` already does the Right Thing™️ with `Accept-Charset` headers
 - `ResponseContentTypeHelper` uses `Encoding.GetEncoding()` but is not passed request data
2016-10-24 14:59:49 -07:00
Doug Bunting 3fdcaecaa8 Correctly handle quoted media type parameter values
- #5349
- fix or add comments about other parsing errors and inconsistencies
 - `MediaType` did not skip whitespace before the type

nits:
- use `+=`
- `<code>` -> `<c>` since the former is not for use within a paragraph
- split tests up to remove `bool expectedResult` parameters
2016-10-24 13:16:09 -07:00
Doug Bunting 4cca6b09f0 Reduce allocations during HTML generation
- #3918
- precompute size of `StringBuilder` in `ExpressionHelper`
- reduce `string` allocations in `ViewDataEvaluator`
 - also get rid of `Enumeration` state machines
- reduce the size of a few objects; use more expression-valued properties
 - e.g. don't store `_modelType` in `ModelExplorer`
- add `EmptyArray<TElement>`; make empty arrays consistently `static`
- avoid `string.Split()` in HTML and tag helpers

nits:
- make `ExpressionHelperTest` tests more stringent
- correct `Message` for an `ArgumentNullException`
- remove excess `using`s in classes I touched (but often ended up leaving otherwise unchanged)
- improve doc comments
- remove `ToString()` call on a `string`
- avoid encoding `string.Empty`
- fix test file name
- remove useless variables
- correct spelling
- improve whitespace
2016-10-03 12:17:47 -07:00
Kiran Challa 26b3b5ea7b [Fixes #4766] Remove disable buffering feature from our action result classes 2016-07-18 13:07:54 -07:00
Ryan Brandenburg 310ab25347 Make tests resilient to Localization (#5011) 2016-07-14 09:28:01 -07:00
Derek Gray 5a3875ea72 Alter content negotiation algorithm so that it can be configured (via
MvcOptions) to always respect an explicit Accept header. Fixes #4612.
2016-06-07 16:12:36 -05:00
Kiran Challa 20a2e748ec Added ValueProviderFactories to ResourceFilterExecutingContext
This enables removing value provider factories from model binding(which is needed in some scenarios like large file uploads)
2016-05-20 04:15:07 -07:00
Doug Bunting d8d2e54506 Remove extra options to manipulate `JsonSerializerSettings`
- #4339: remove non-recommended JSON formatter constructors
 - affects `JsonInputFormatter`, `JsonOutputFormatter`, `JsonPatchInputFormatter`
 - `JsonOutputFormatter` cleanup also impacts `JsonHelper`
 - rename and make `SerializerSettingsProvider` class public; use it as appropriate
- #4409: make `SerializerSetings` properties get-only and `protected`
 - affects `JsonInputFormatter`, `JsonOutputFormatter`

Recommended patterns:
- change `JsonSerializerSettings` values in `MvcJsonOptions` for almost all customizations
- find `JsonOutputFormatter` in `MvcOptions.OutputFormatters` when limiting per-result formatters
- start with `JsonSerializerSettingsProvider.CreateSerializerSettings()` when customizing a per-result formatter
2016-04-27 14:48:16 -07:00
Doug Bunting 6bf25cecec React to HttpAbstractions namespace changes
- aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592
- clean up `using`s
2016-03-30 16:19:42 -07:00
Kiran Challa fd3ee49987 [Fixes #4085] Controller helper inconsistency: HttpNotFound(), Ok() 2016-02-19 09:25:04 -08:00
jacalvar 910f0139f9 [Fixes #4050] Throw an exception on CanRead/Write and GetSupportedContentTypes when the list of media types is empty 2016-02-16 17:16:16 -08:00
jacalvar 65858b8d8b [Fixes #4051] Split OutputFormatter into OutputFormatter and TextOutputFormatter 2016-02-12 12:04:18 -08:00
jacalvar fe639f028f [Fixes 3961] Consider InputFormatter behavior when we can't read the charset
* Broken InputFormatter into InputFormatter and TextInputFormatter
* Added an exception to ModelState inside ReadAsync on TextInputFormatter
  when we can't find a valid encoding to read the body.
2016-02-05 10:42:36 -08:00
N. Taylor Mullen 3be7fbdf9f Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:18:33 -08:00
N. Taylor Mullen 6a6c8ca544 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:17:07 -08:00