Skip to content

Commit dd56c6e

Browse files
authored
Clarify ImportMap component sections (#35229)
1 parent 0187f63 commit dd56c6e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: aspnetcore/blazor/fundamentals/static-files.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Assets are delivered via the <xref:Microsoft.AspNetCore.Components.ComponentBase
6666

6767
## `ImportMap` component
6868

69-
*This section applies to server-side Blazor apps.*
69+
*This section applies to Blazor Web Apps that call <xref:Microsoft.AspNetCore.Builder.RazorComponentsEndpointRouteBuilderExtensions.MapRazorComponents%2A>.*
7070

7171
The `ImportMap` component (<xref:Microsoft.AspNetCore.Components.ImportMap>) represents an import map element (`<script type="importmap"></script>`) that defines the import map for module scripts. The Import Map component is placed in `<head>` content of the root component, typically the `App` component (`Components/App.razor`).
7272

@@ -190,6 +190,8 @@ The preceding code results in the following import map:
190190

191191
## Import map Content Security Policy (CSP) violations
192192

193+
*This section applies to Blazor Web Apps that call <xref:Microsoft.AspNetCore.Builder.RazorComponentsEndpointRouteBuilderExtensions.MapRazorComponents%2A>.*
194+
193195
The `ImportMap` component is rendered as an inline `<script>` tag, which violates a strict [Content Security Policy (CSP)](https://developer.mozilla.org/docs/Web/HTTP/Guides/CSP) that sets the `default-src` or `script-src` directive.
194196

195197
For examples of how to address the policy violation with Subresource Integrity (SRI) or a cryptographic nonce, see [Resolving CSP violations with Subresource Integrity (SRI) or a nonce](xref:blazor/security/content-security-policy#resolving-csp-violations-with-subresource-integrity-sri-or-a-cryptographic-nonce).

0 commit comments

Comments
 (0)