Skip to content

Commit b3331cc

Browse files
Merge pull request #34566 from dotnet/main
Merge to Live
2 parents 6ac6727 + bccb03a commit b3331cc

File tree

12 files changed

+58
-32
lines changed

12 files changed

+58
-32
lines changed

aspnetcore/blazor/host-and-deploy/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ To provide configuration for the Blazor app's base path of `https://www.contoso.
196196

197197
By configuring the app base path, a component that isn't in the root directory can construct URLs relative to the app's root path. Components at different levels of the directory structure can build links to other resources at locations throughout the app. The app base path is also used to intercept selected hyperlinks where the `href` target of the link is within the app base path URI space. The <xref:Microsoft.AspNetCore.Components.Routing.Router> component handles the internal navigation.
198198

199-
Place the the `<base>` tag in `<head>` markup ([location of `<head>` content](xref:blazor/project-structure#location-of-head-and-body-content)) before any elements with attribute values that are URLs, such as the `href` attributes of `<link>` elements.
199+
Place the `<base>` tag in `<head>` markup ([location of `<head>` content](xref:blazor/project-structure#location-of-head-and-body-content)) before any elements with attribute values that are URLs, such as the `href` attributes of `<link>` elements.
200200

201201
:::moniker range=">= aspnetcore-8.0"
202202

aspnetcore/blazor/security/webassembly/standalone-with-identity/qrcodes-for-authenticator-apps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Add a package reference to the client project for the [`Net.Codecrete.QrCodeGene
5151

5252
Set the site name in the app settings file of the client project. Use a meaningful site name that users can identify easily in their authenticator app. Developers usually set a site name that matches the company's name. We recommend limiting the site name length to 30 characters or less to allow the site name to display on narrow mobile device screens.
5353

54-
In the following example, the the company name is `Weyland-Yutani Corporation` (&copy;1986 20th Century Studios [*Aliens*](https://www.20thcenturystudios.com/movies/aliens)).
54+
In the following example, the company name is `Weyland-Yutani Corporation` (&copy;1986 20th Century Studios [*Aliens*](https://www.20thcenturystudios.com/movies/aliens)).
5555

5656
Added to `wwwroot/appsettings.json`:
5757

@@ -858,7 +858,7 @@ If 2FA is enabled, buttons appear to disable 2FA and regenerate recovery codes.
858858
}
859859
```
860860

861-
## Link to the the Manage 2FA page
861+
## Link to the Manage 2FA page
862862

863863
Add a link to the navigation menu for users to reach the `Manage2fa` component page.
864864

aspnetcore/blazor/tutorials/movie-database-app/part-4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ Navigate to the movies `Index` page to see the seeded movies:
265265

266266
## Bind a form to a model
267267

268-
Review the the `Edit` component (`Components/Pages/MoviePages/Edit.razor`).
268+
Review the `Edit` component (`Components/Pages/MoviePages/Edit.razor`).
269269

270270
When an HTTP GET request is made for the `Edit` component page (for example at the relative URL: `/movies/edit?id=6`):
271271

aspnetcore/diagnostics/asp0028.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ On the server machine that supports `IPv6`, [IPv6Any](/dotnet/api/system.net.ipa
2121

2222
`127.0.0.1` is the IPv4 loopback address. `::1` is the IPv6 loopback address. `Any` is the wildcard address for IPv4. `IPv6Any` is the wildcard address for IPv6.
2323

24-
Current behavior with with IPv6 when using HTTP/1.x or HTTP/2.0:
24+
Current behavior with IPv6 when using HTTP/1.x or HTTP/2.0:
2525

2626
* `localhost` resolves to `[::1]`.
2727
* `[::1]` isn't accepted by the server, which forces a retry using `127.0.0.1`, creating a repeated cycle.

aspnetcore/fundamentals/openapi/aspnetcore-openapi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to generate and customize OpenAPI documents in an ASP.NET
55
ms.author: safia
66
monikerRange: '>= aspnetcore-6.0'
77
ms.custom: mvc
8-
ms.date: 12/11/2024
8+
ms.date: 01/23/2025
99
uid: fundamentals/openapi/aspnetcore-openapi
1010
---
1111
# Generate OpenAPI documents
@@ -48,7 +48,7 @@ The following code:
4848
* Adds OpenAPI services using the <xref:Microsoft.Extensions.DependencyInjection.OpenApiServiceCollectionExtensions.AddOpenApi%2A> extension method on the app builder's service collection.
4949
* Maps an endpoint for viewing the OpenAPI document in JSON format with the <xref:Microsoft.AspNetCore.Builder.OpenApiEndpointRouteBuilderExtensions.MapOpenApi%2A> extension method on the app.
5050

51-
[!code-csharp[](~/fundamentals/openapi/samples/9.x/WebMinOpenApi/Program.cs?name=snippet_first&highlight=3,7)]
51+
[!code-csharp[](~/fundamentals/openapi/samples/9.x/WebMinOpenApi/Program.cs?name=snippet_first&highlight=3,9)]
5252

5353
Launch the app and navigate to `https://localhost:<port>/openapi/v1.json` to view the generated OpenAPI document.
5454

aspnetcore/fundamentals/openapi/samples/9.x/WebMinOpenApi/Program.cs

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//#define DOCUMENTtransformer1
44
//#define DOCUMENTtransformer2
55
#define DOCUMENTtransformerUse999
6-
//#define DEFAULT
76
//#define FIRST
87
//#define OPENAPIWITHSCALAR
98
//#define MAPOPENAPIWITHCACHING
@@ -80,7 +79,10 @@ internal record WeatherForecast(DateTime Date, int TemperatureC, string? Summary
8079

8180
var app = builder.Build();
8281

83-
app.MapOpenApi();
82+
if (app.Environment.IsDevelopment())
83+
{
84+
app.MapOpenApi();
85+
}
8486

8587
app.MapGet("/", () => "Hello world!");
8688

@@ -107,7 +109,10 @@ internal record WeatherForecast(DateTime Date, int TemperatureC, string? Summary
107109

108110
var app = builder.Build();
109111

110-
app.MapOpenApi();
112+
if (app.Environment.IsDevelopment())
113+
{
114+
app.MapOpenApi();
115+
}
111116

112117
app.MapGet("/", () => "Hello world!");
113118

@@ -161,7 +166,10 @@ public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransf
161166

162167
var app = builder.Build();
163168

164-
app.MapOpenApi();
169+
if (app.Environment.IsDevelopment())
170+
{
171+
app.MapOpenApi();
172+
}
165173

166174
app.MapGet("/", () => "Hello world!");
167175

@@ -189,7 +197,10 @@ public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransf
189197

190198
var app = builder.Build();
191199

192-
app.MapOpenApi();
200+
if (app.Environment.IsDevelopment())
201+
{
202+
app.MapOpenApi();
203+
}
193204

194205
app.MapGet("/world", () => "Hello world!")
195206
.WithGroupName("internal");
@@ -253,7 +264,10 @@ public async Task TransformAsync(OpenApiDocument document, OpenApiDocumentTransf
253264

254265
var app = builder.Build();
255266

256-
app.MapOpenApi();
267+
if (app.Environment.IsDevelopment())
268+
{
269+
app.MapOpenApi();
270+
}
257271

258272
app.MapGet("/", () => new Body { Amount = 1.1m });
259273

@@ -279,9 +293,10 @@ public class Body {
279293

280294
var app = builder.Build();
281295

282-
app.MapOpenApi();
283296
if (app.Environment.IsDevelopment())
284297
{
298+
app.MapOpenApi();
299+
285300
app.UseSwaggerUI(options =>
286301
{
287302
options.SwaggerEndpoint("/openapi/v1.json", "v1");
@@ -342,8 +357,11 @@ public class Body {
342357

343358
app.UseOutputCache();
344359

345-
app.MapOpenApi()
346-
.CacheOutput();
360+
if (app.Environment.IsDevelopment())
361+
{
362+
app.MapOpenApi()
363+
.CacheOutput();
364+
}
347365

348366
app.MapGet("/", () => "Hello world!");
349367

@@ -365,10 +383,9 @@ public class Body {
365383

366384
var app = builder.Build();
367385

368-
app.MapOpenApi();
369-
370386
if (app.Environment.IsDevelopment())
371387
{
388+
app.MapOpenApi();
372389
app.MapScalarApiReference();
373390
}
374391

@@ -386,7 +403,10 @@ public class Body {
386403

387404
var app = builder.Build();
388405

389-
app.MapOpenApi();
406+
if (app.Environment.IsDevelopment())
407+
{
408+
app.MapOpenApi();
409+
}
390410

391411
app.MapGet("/", () => "Hello world!");
392412

@@ -419,7 +439,10 @@ public class Body {
419439

420440
var app = builder.Build();
421441

422-
app.MapOpenApi();
442+
if (app.Environment.IsDevelopment())
443+
{
444+
app.MapOpenApi();
445+
}
423446

424447
app.MapGet("/", () => "Hello world!");
425448

@@ -473,7 +496,10 @@ public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext
473496

474497
var app = builder.Build();
475498

476-
app.MapOpenApi();
499+
if (app.Environment.IsDevelopment())
500+
{
501+
app.MapOpenApi();
502+
}
477503

478504
app.MapGet("/", () => "Hello world!");
479505

aspnetcore/grpc/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: jamesnk
44
description: Learn about gRPC services with Kestrel server and the ASP.NET Core stack.
55
monikerRange: '>= aspnetcore-3.0'
66
ms.author: wpickett
7-
ms.date: 09/28/2021
7+
ms.date: 01/24/2024
88
uid: grpc/index
99
---
1010
# Overview for gRPC on .NET

aspnetcore/security/anti-request-forgery.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In addition to the scenario where the user selects the button to submit the form
4040

4141
These alternative scenarios don't require any action or input from the user other than initially visiting the malicious site.
4242

43-
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send an `https://www.good-banking-site.com/` request as easily as it can send an insecure request.
43+
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send `https://www.good-banking-site.example.com/` a request just as easily as it can send an insecure request.
4444

4545
Some attacks target endpoints that respond to GET requests, in which case an image tag can be used to perform the action. This form of attack is common on forum sites that permit images but block JavaScript. Apps that change state on GET requests, where variables or resources are altered, are vulnerable to malicious attacks. **GET requests that change state are insecure. A best practice is to never change state on a GET request.**
4646

@@ -359,7 +359,7 @@ In addition to the scenario where the user selects the button to submit the form
359359

360360
These alternative scenarios don't require any action or input from the user other than initially visiting the malicious site.
361361

362-
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send an `https://www.good-banking-site.com/` request just as easily as it can send an insecure request.
362+
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send `https://www.good-banking-site.example.com/` a request just as easily as it can send an insecure request.
363363

364364
Some attacks target endpoints that respond to GET requests, in which case an image tag can be used to perform the action. This form of attack is common on forum sites that permit images but block JavaScript. Apps that change state on GET requests, where variables or resources are altered, are vulnerable to malicious attacks. **GET requests that change state are insecure. A best practice is to never change state on a GET request.**
365365

@@ -635,7 +635,7 @@ In addition to the scenario where the user selects the button to submit the form
635635

636636
These alternative scenarios don't require any action or input from the user other than initially visiting the malicious site.
637637

638-
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send an `https://www.good-banking-site.com/` request just as easily as it can send an insecure request.
638+
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send `https://www.good-banking-site.example.com/` a request just as easily as it can send an insecure request.
639639

640640
Some attacks target endpoints that respond to GET requests, in which case an image tag can be used to perform the action. This form of attack is common on forum sites that permit images but block JavaScript. Apps that change state on GET requests, where variables or resources are altered, are vulnerable to malicious attacks. **GET requests that change state are insecure. A best practice is to never change state on a GET request.**
641641

@@ -887,7 +887,7 @@ In addition to the scenario where the user selects the button to submit the form
887887

888888
These alternative scenarios don't require any action or input from the user other than initially visiting the malicious site.
889889

890-
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send an `https://www.good-banking-site.com/` request just as easily as it can send an insecure request.
890+
Using HTTPS doesn't prevent a CSRF attack. The malicious site can send `https://www.good-banking-site.example.com/` a request just as easily as it can send an insecure request.
891891

892892
Some attacks target endpoints that respond to GET requests, in which case an image tag can be used to perform the action. This form of attack is common on forum sites that permit images but block JavaScript. Apps that change state on GET requests, where variables or resources are altered, are vulnerable to malicious attacks. **GET requests that change state are insecure. A best practice is to never change state on a GET request.**
893893

aspnetcore/security/anti-request-forgery/samples_snapshot/vulnerable-form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1>Congratulations! You're a Winner!</h1>
2-
<form action="https://good-banking-site.com/api/account" method="post">
2+
<form action="https://www.good-banking-site.example.com/api/account" method="post">
33
<input type="hidden" name="Transaction" value="withdraw" />
44
<input type="hidden" name="Amount" value="1000000" />
55
<input type="submit" value="Click to collect your prize!" />

aspnetcore/security/authorization/roles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ If multiple attributes are applied at the controller and action levels, ***all**
138138

139139
In the preceding `ControlAllPanelController` controller:
140140

141-
* Members of the `Administrator` role or the `PowerUser` role can access the controller and the `SetTime` action.
142-
* Only members of the `Administrator` role can access the `ShutDown` action.
141+
* Members of the `Administrator` role can access the controller and the `SetTime` action.
142+
* Only members of the `Administrator` **and** the `PowerUser` role can access the `ShutDown` action.
143143

144144
You can also lock down a controller but allow anonymous, unauthenticated access to individual actions.
145145

0 commit comments

Comments
 (0)