Search Results for

    Show / Hide Table of Contents
    View Source

    Class CspNonceServiceExtensions

    Extension methods for ICspNonceService.

    Inheritance
    object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Core.dll
    Syntax
    public static class CspNonceServiceExtensions

    Methods

    View Source

    GetNonceAttribute(ICspNonceService)

    Gets a nonce attribute for the current request, ready to be written into a tag.

    Declaration
    public static string GetNonceAttribute(this ICspNonceService cspNonceService)
    Parameters
    Type Name Description
    ICspNonceService cspNonceService

    The CSP nonce service.

    Returns
    Type Description
    string

    The attribute including a leading space (for example nonce="abc123"), or an empty string when no nonce is available for the current request.

    Remarks

    The nonce is HTML encoded, as ICspNonceService can be replaced and the returned attribute is written into markup without further encoding.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX