Skip to content

Commit d761178

Browse files
Fix inconsistent and incorrect code language names (#35145)
1 parent e840473 commit d761178

File tree

33 files changed

+156
-156
lines changed

33 files changed

+156
-156
lines changed

aspnetcore/fundamentals/minimal-apis/handle-errors/includes/handle-errors7.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In a Minimal API app, there are two different built-in centralized mechanisms to
1111

1212
This section refers to the following Minimal API app to demonstrate ways to handle exceptions. It throws an exception when the endpoint `/exception` is requested:
1313

14-
``` csharp
14+
```csharp
1515
var builder = WebApplication.CreateBuilder(args);
1616
var app = builder.Build();
1717

@@ -65,7 +65,7 @@ In non-development environments, use the [Exception Handler Middleware](xref:fun
6565
For example, the following code changes the app to respond with an [RFC 7807](https://tools.ietf.org/html/rfc7807)-compliant payload to the client. For more information, see [Problem Details](#problem-details) section.
6666

6767

68-
``` csharp
68+
```csharp
6969
var builder = WebApplication.CreateBuilder(args);
7070
var app = builder.Build();
7171

@@ -84,7 +84,7 @@ app.Run();
8484

8585
Consider the following Minimal API app.
8686

87-
``` csharp
87+
```csharp
8888
var builder = WebApplication.CreateBuilder(args);
8989
var app = builder.Build();
9090

@@ -103,7 +103,7 @@ The [`Status Code Pages middleware`](xref:fundamentals/error-handling#sestatusco
103103

104104
For example, the following example changes the app to respond with an [RFC 7807](https://tools.ietf.org/html/rfc7807)-compliant payload to the client for all client and server responses, including routing errors (for example, `404 NOT FOUND`). For more information, see the [Problem Details](#problem-details) section.
105105

106-
``` csharp
106+
```csharp
107107
var builder = WebApplication.CreateBuilder(args);
108108
var app = builder.Build();
109109

@@ -127,7 +127,7 @@ Minimal API apps can be configured to generate problem details response for all
127127

128128
The following code configures the app to generate problem details:
129129

130-
``` csharp
130+
```csharp
131131
var builder = WebApplication.CreateBuilder(args);
132132
builder.Services.AddProblemDetails();
133133

aspnetcore/fundamentals/servers/httpsys.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The preceding Windows 11 Build versions may require the use of a [Windows Inside
7676

7777
HTTP/3 is discovered as an upgrade from HTTP/1.1 or HTTP/2 via the `alt-svc` header. That means the first request will normally use HTTP/1.1 or HTTP/2 before switching to HTTP/3. Http.Sys doesn't automatically add the `alt-svc` header, it must be added by the application. The following code is a middleware example that adds the `alt-svc` response header.
7878

79-
```C#
79+
```csharp
8080
app.Use((context, next) =>
8181
{
8282
context.Response.Headers.AltSvc = "h3=\":443\"";

aspnetcore/fundamentals/servers/httpsys/includes/httpsys5-7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The preceding Windows 11 Build versions may require the use of a [Windows Inside
6060

6161
HTTP/3 is discovered as an upgrade from HTTP/1.1 or HTTP/2 via the `alt-svc` header. That means the first request will normally use HTTP/1.1 or HTTP/2 before switching to HTTP/3. Http.Sys doesn't automatically add the `alt-svc` header, it must be added by the application. The following code is a middleware example that adds the `alt-svc` response header.
6262

63-
```C#
63+
```csharp
6464
app.Use((context, next) =>
6565
{
6666
context.Response.Headers.AltSvc = "h3=\":443\"";

aspnetcore/fundamentals/servers/yarp/authn-authz.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ No authentication or authorization is performed on requests unless enabled in th
2323
Authorization policies can be specified per route via [RouteConfig.AuthorizationPolicy](xref:Yarp.ReverseProxy.Configuration.RouteConfig) and can be bound from the `Routes` sections of the config file. As with other route properties, this can be modified and reloaded without restarting the proxy. Policy names are case insensitive.
2424

2525
Example:
26-
```JSON
26+
```json
2727
{
2828
"ReverseProxy": {
2929
"Routes": {

aspnetcore/fundamentals/servers/yarp/config-files.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The reverse proxy can load configuration for routes and clusters from files usin
1717

1818
## Loading Configuration
1919
To load the proxy configuration from IConfiguration add the following code in Program.cs:
20-
```c#
20+
```csharp
2121
using Microsoft.AspNetCore.Builder;
2222
using Microsoft.Extensions.DependencyInjection;
2323

@@ -42,13 +42,13 @@ Configuration can be modified during the load sequence using [Configuration Filt
4242
## Multiple Configuration Sources
4343
As of 1.1, YARP supports loading the proxy configuration from multiple sources. LoadFromConfig may be called multiple times referencing different IConfiguration sections or may be combine with a different config source like InMemory. Routes can reference clusters from other sources. Note merging partial config from different sources for a given route or cluster is not supported.
4444

45-
```c#
45+
```csharp
4646
services.AddReverseProxy()
4747
.LoadFromConfig(Configuration.GetSection("ReverseProxy1"))
4848
.LoadFromConfig(Configuration.GetSection("ReverseProxy2"));
4949
```
5050
or
51-
```c#
51+
```csharp
5252

5353
services.AddReverseProxy()
5454
.LoadFromMemory(routes, clusters)
@@ -62,7 +62,7 @@ File-based configuration is dynamically mapped to the types in [Yarp.ReverseProx
6262
The configuration consists of a named section that you specified above via `Configuration.GetSection("ReverseProxy")`, and contains subsections for routes and clusters.
6363

6464
Example:
65-
```JSON
65+
```json
6666
{
6767
"ReverseProxy": {
6868
"Routes": {
@@ -105,7 +105,7 @@ The clusters section is an unordered collection of named clusters. A cluster pri
105105
For additional fields see [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.ClusterConfig).
106106

107107
## All config properties
108-
```JSON
108+
```json
109109
{
110110
// Base URLs the server listens on, must be configured independently of the routes below
111111
"Urls": "http://localhost:5000;https://localhost:5001",

aspnetcore/fundamentals/servers/yarp/config-filters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Filters can be used for a variety of purposes such as:
2525
## AddConfigFilter
2626
Configuration filters are registered in the Dependency Injection system using the [AddConfigFilter](xref:Microsoft.Extensions.DependencyInjection.ReverseProxyServiceCollectionExtensions) API. Any number of unique filters can be added and will be applied in the order added.
2727

28-
```C#
28+
```csharp
2929
// Load the configuration and register a config filter
3030
services.AddReverseProxy()
3131
.LoadFromConfig(_configuration.GetSection("ReverseProxy"))
@@ -39,7 +39,7 @@ Filters are called for each route and cluster each time configuration is loaded
3939

4040
This example fills in destination addresses from environment variables and sets the route's Order field to 1.
4141

42-
```C#
42+
```csharp
4343
using System;
4444
using System.Collections.Generic;
4545
using System.Text.RegularExpressions;

aspnetcore/fundamentals/servers/yarp/cors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The requests won't be automatically matched for cors preflight requests unless e
2323
CORS policies can be specified per route via [RouteConfig.CorsPolicy](xref:Yarp.ReverseProxy.Configuration.RouteConfig) and can be bound from the `Routes` sections of the config file. As with other route properties, this can be modified and reloaded without restarting the proxy. Policy names are case insensitive.
2424

2525
Example:
26-
```JSON
26+
```json
2727
{
2828
"ReverseProxy": {
2929
"Routes": {

aspnetcore/fundamentals/servers/yarp/dests-health-checks.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ YARP can proactively monitor destination health by sending periodic probing requ
1919
There are several cluster-wide configuration settings controlling active health checks that can be set either in the config file or in code. A dedicated health endpoint can also be specified per destination.
2020

2121
#### File example
22-
```JSON
22+
```json
2323
"Clusters": {
2424
"cluster1": {
2525
"HealthCheck": {
@@ -49,7 +49,7 @@ There are several cluster-wide configuration settings controlling active health
4949
```
5050

5151
#### Code example
52-
```C#
52+
```csharp
5353
var clusters = new[]
5454
{
5555
new ClusterConfig()
@@ -132,7 +132,7 @@ There are 2 main extensibility points in the active health check subsystem.
132132

133133
The below is a simple example of a custom `IActiveHealthCheckPolicy` marking destination as `Healthy`, if a successful response code was returned for a probe, and as `Unhealthy` otherwise.
134134

135-
```C#
135+
```csharp
136136
public class FirstUnsuccessfulResponseHealthPolicy : IActiveHealthCheckPolicy
137137
{
138138
private readonly IDestinationHealthUpdater _healthUpdater;
@@ -169,13 +169,13 @@ public class FirstUnsuccessfulResponseHealthPolicy : IActiveHealthCheckPolicy
169169

170170
The default `IProbingRequestFactory` uses the same `HttpRequest` configuration as proxy requests, to customize that implement your own `IProbingRequestFactory` and register it in DI like the below.
171171

172-
```C#
172+
```csharp
173173
services.AddSingleton<IProbingRequestFactory, CustomProbingRequestFactory>();
174174
```
175175

176176
The below is a simple example of a customer `IProbingRequestFactory` concatenating `DestinationConfig.Address` and a fixed health probe path to create the probing request URI.
177177

178-
```C#
178+
```csharp
179179
public class CustomProbingRequestFactory : IProbingRequestFactory
180180
{
181181
public HttpRequestMessage CreateRequest(ClusterConfig clusterConfig, DestinationConfig destinationConfig)
@@ -196,7 +196,7 @@ There is one important difference from the active health check logic. Once a des
196196
There are several cluster-wide configuration settings controlling passive health checks that can be set either in the config file or in code.
197197

198198
#### File example
199-
```JSON
199+
```json
200200
"Clusters": {
201201
"cluster1": {
202202
"HealthCheck": {
@@ -222,7 +222,7 @@ There are several cluster-wide configuration settings controlling passive health
222222
```
223223

224224
#### Code example
225-
```C#
225+
```csharp
226226
var clusters = new[]
227227
{
228228
new ClusterConfig()
@@ -252,7 +252,7 @@ Passive health check settings are specified on the cluster level in `Cluster/Hea
252252

253253
Passive health checks require the `PassiveHealthCheckMiddleware` added into the pipeline for them to work. The default `MapReverseProxy(this IEndpointRouteBuilder endpoints)` method does it automatically, but in case of a manual pipeline construction the [UsePassiveHealthChecks](xref:Microsoft.AspNetCore.Builder.AppBuilderHealthExtensions) method must be called to add that middleware as shown in the example below.
254254

255-
```C#
255+
```csharp
256256
endpoints.MapReverseProxy(proxyPipeline =>
257257
{
258258
proxyPipeline.UseAffinitizedDestinationLookup();
@@ -279,7 +279,7 @@ Global parameters are set via the options mechanism using `TransportFailureRateH
279279
- `DefaultFailureRateLimit` - default failure rate limit for a destination to be marked as unhealthy that is applied if it's not set on a cluster's metadata. The value is in range `(0,1)`. Default is `0.3` (30%).
280280

281281
Global policy options can be set in code as follows:
282-
```C#
282+
```csharp
283283
services.Configure<TransportFailureRateHealthPolicyOptions>(o =>
284284
{
285285
o.DetectionWindowSize = TimeSpan.FromSeconds(30);
@@ -318,7 +318,7 @@ There is one main extensibility point in the passive health check subsystem, the
318318

319319
The below is a simple example of a custom `IPassiveHealthCheckPolicy` marking destination as `Unhealthy` on the first unsuccessful response to a proxied request.
320320

321-
```C#
321+
```csharp
322322
public class FirstUnsuccessfulResponseHealthPolicy : IPassiveHealthCheckPolicy
323323
{
324324
private static readonly TimeSpan _defaultReactivationPeriod = TimeSpan.FromSeconds(60);
@@ -355,7 +355,7 @@ Destinations health state is used to determine which of them are eligible for re
355355

356356
### Configuration
357357
#### File example
358-
```JSON
358+
```json
359359
"Clusters": {
360360
"cluster1": {
361361
"HealthCheck": {
@@ -377,7 +377,7 @@ Destinations health state is used to determine which of them are eligible for re
377377
```
378378

379379
#### Code example
380-
```C#
380+
```csharp
381381
var clusters = new[]
382382
{
383383
new ClusterConfig()

aspnetcore/fundamentals/servers/yarp/diagnosing-yarp-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The [Metrics sample](https://github.com/microsoft/reverse-proxy/tree/main/sample
114114

115115
To use either of these, create a class implementing a [`Yarp.Telemetry.Consumption` interface](xref:Yarp.Telemetry.Consumption#interfaces), such as <xref:Yarp.Telemetry.Consumption.IForwarderTelemetryConsumer>:
116116

117-
```C#
117+
```csharp
118118
public class ForwarderTelemetry : IForwarderTelemetryConsumer
119119
{
120120
/// Called before forwarding a request.

aspnetcore/fundamentals/servers/yarp/direct-forwarding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ In this example the IHttpForwarder is registered in DI, injected into the endpoi
4545

4646
The optional transforms show how to copy all request headers except for the `Host`, it's common that the destination requires its own `Host` from the url.
4747

48-
```C#
48+
```csharp
4949
using System;
5050
using System.Diagnostics;
5151
using System.Net;
@@ -136,7 +136,7 @@ internal class CustomTransformer : HttpTransformer
136136

137137
There are also [extension methods](xref:Microsoft.AspNetCore.Builder.DirectForwardingIEndpointRouteBuilderExtensions) available that simplify the mapping of IHttpForwarder to endpoints.
138138

139-
```C#
139+
```csharp
140140
app.MapForwarder("/{**catch-all}", "https://localhost:10000/", requestConfig, transformer, httpClient);
141141
```
142142

0 commit comments

Comments
 (0)