Commit Graph

21 Commits

Author SHA1 Message Date
Mickaël Derriey 4a2bd2adbf Source server variables from IIS when running ANCM in-proc (#10022) 2019-05-15 08:26:29 -07:00
Ryan Nowak e401f35b45
Header propagation sample and UX improvements (#9793)
Creating a sample for the header propagation package and some various
misc UX improvements based on building the sample.

A small list:
- allow duplicate inbound names
- de-dupe based on outbound names
- add sugar for configuration
- simplify pattern for transforming values
- add error message for missing middleware

Also a few small perf things.

I started this out by wanting to remove the following from the
configuration pattern:
```C#
options.Headers.Add("X-TraceId", null);
```

This pattern with null is undiscoverable, but we didn't provide
something simpler. The most common case was to add a custom collection
type so we can define sugar methods.

The next realization is that in practical case (dist tracing sample) you
either way to *key* off of the same inbound header twice, or you don't
have an inbound header at all, and you will synthesize the value every
time. This means that the way we're treating inbound header names is a
bit wrong. We don't want inbound header names to be unique, we want
*outbound header names to be unique*.

Next, I want to consolidate DefaultValue and ValueFactory. The problems
I saw with this:
- DefaultValue is a trap. It's rare to use a static value.
- ValueFactory really wants the header name *and* value

I think what's there now is much more terse to work with.
2019-05-07 11:07:42 -07:00
Alessio Franceschelli f28cf2bbc8 HeaderPropagation: propagate incoming request headers to outgoing HTTP requests (#7921)
* Ported HeaderPropagation from aspnet/Extensions

* Introduced Middleware

* Refactored middleware logic

* Refactored builder extensions

* Copyright notice

* Test for friendly exception on Builder

* Fixed header name selection when no output name specified

* Set comparer for the dictionary of headers

* Refactored configuration as Dictionary

* Renamed state objects

* renamed OutboundHeaderName in configuration

* Changed DefaultValuesGenerator to ValueFactory

* Missing docs

* Removed AlwaysAdd and added tests for null entry in configuration

* Improved docs

* Update src/Middleware/HeaderPropagation/src/DependencyInjection/HeaderPropagationExtensions.cs

Co-Authored-By: alefranz <alessio@franceschelli.me>

* Moved dependency injection extensions

* DI: reused ServiceCollection extension in the HttpClientBuilder one

* Moved service registration

* Update src/Middleware/HeaderPropagation/src/HeaderPropagationEntry.cs

Co-Authored-By: alefranz <alessio@franceschelli.me>

* more docs

* Improved docs

* Update src/Middleware/HeaderPropagation/src/HeaderPropagationValues.cs

Co-Authored-By: alefranz <alessio@franceschelli.me>

* Fixed build

* Update eng/SharedFramework.Local.props

Co-Authored-By: alefranz <alessio@franceschelli.me>

* Updated tests for null config

* Reversed condition on HeaderPropagationMessageHandler as suggested

* Added docs for HeaderPropagationMessageHandler

* Changed proj to ship package to NuGet
2019-03-29 12:00:46 -07:00
Steve Sanderson 18c1b994df
Basic integration tests for NodeServices (#8029) 2019-02-28 17:58:57 +00: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
Chris Ross 4e44025a52
Replace IHostingEnvironment with IWebHostEnvironment (#7725) 2019-02-19 21:11:52 -08:00
James Newton-King 51047ef9d6
Update solutions to use correct IIS project location (#6344) 2019-01-04 15:28:59 +13:00
James Newton-King cc899e2be7
Move EndpointModel and IEndpointConventionBuilder to HTTP abstractions (#4274) 2018-12-17 18:38:49 +13:00
James Newton-King 6dc28d8a4e
Update CORS middleware to use endpoint metadata (#4460) 2018-12-15 07:51:22 +13:00
Nate McMaster 87629bbad9
Update Middleware.sln and Kestrel.sln to workaround NU1105 error 2018-12-11 18:19:36 -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 2c4d586809
Merge 'release/2.1' into release/2.2
Co-authored-by: Justin Kotalik <jukotali@microsoft.com>
2018-12-10 15:56:42 -08:00
Justin Kotalik 5f843f223e
[2.1] Make Antiforgery, ResponseCaching, StaticFiles, and Cors use project ref (#4484) 2018-12-07 14:30:50 -08:00
Nate McMaster 11fdf9b50a
Fix bad merge of .csproj and update Middleware.sln 2018-12-04 14:59:11 -08:00
Nate McMaster 1be2b427de
Merge branch 'release/2.1' into release/2.2 2018-12-04 14:23:24 -08:00
Nate McMaster 7078102961
Update targets and projects to build Localization projects 2018-11-30 15:13:05 -08:00
Nate McMaster 04fc8ae493
Update targets and projects to build BasicMiddleware projects 2018-11-30 14:44:17 -08:00
Nate McMaster 8ce7bb7f16
Add HealthChecks to Middleware.sln 2018-11-21 15:39:10 -08:00
Nate McMaster 6a6c88d80b
Merge source code from aspnet/Diagnostics to this repo 2018-11-21 14:23:55 -08:00
Nate McMaster 27a47d07c5
Reorganize the src/WebSockets/ folder to follow new source code organization conventions 2018-11-09 13:06:13 -08:00