Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublishedRequest

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Routing
    Assembly: Umbraco.Core.dll
    Syntax
    public class PublishedRequest : IPublishedRequest

    Constructors

    View Source

    PublishedRequest(Uri, String, IPublishedContent, Boolean, ITemplate, DomainAndUri, String, String, Nullable<Int32>, Nullable<IReadOnlyList<String>>, Nullable<IReadOnlyDictionary<String, String>>, Boolean, Boolean)

    Initializes a new instance of the PublishedRequest class.

    Declaration
    public PublishedRequest(Uri uri, string absolutePathDecoded, IPublishedContent publishedContent, bool isInternalRedirect, ITemplate template, DomainAndUri domain, string culture, string redirectUrl, int? responseStatusCode, IReadOnlyList<string>? cacheExtensions, IReadOnlyDictionary<string, string>? headers, bool setNoCacheHeader, bool ignorePublishedContentCollisions)
    Parameters
    Type Name Description
    Uri uri
    System.String absolutePathDecoded
    IPublishedContent publishedContent
    System.Boolean isInternalRedirect
    ITemplate template
    DomainAndUri domain
    System.String culture
    System.String redirectUrl
    System.Nullable<System.Int32> responseStatusCode
    System.Nullable<IReadOnlyList<System.String>> cacheExtensions
    System.Nullable<IReadOnlyDictionary<System.String, System.String>> headers
    System.Boolean setNoCacheHeader
    System.Boolean ignorePublishedContentCollisions

    Properties

    View Source

    AbsolutePathDecoded

    Gets the URI decoded absolute path of the Uri

    Declaration
    public string AbsolutePathDecoded { get; }
    Property Value
    Type Description
    System.String
    View Source

    CacheExtensions

    Gets a list of Extensions to append to the Response.Cache object.

    Declaration
    public IReadOnlyList<string>? CacheExtensions { get; }
    Property Value
    Type Description
    System.Nullable<IReadOnlyList<System.String>>
    View Source

    Culture

    Gets the content request's culture.

    Declaration
    public string Culture { get; }
    Property Value
    Type Description
    System.String
    Remarks

    This will get mapped to a CultureInfo eventually but CultureInfo are expensive to create so we want to leave that up to the localization middleware to do. See https://github.com/dotnet/aspnetcore/blob/b795ac3546eb3e2f47a01a64feb3020794ca33bb/src/Middleware/Localization/src/RequestLocalizationMiddleware.cs#L165.

    View Source

    Domain

    Gets the content request's domain.

    Declaration
    public DomainAndUri Domain { get; }
    Property Value
    Type Description
    DomainAndUri
    Remarks

    Is a DomainAndUri object ie a standard Domain plus the fully qualified uri. For example, the Domain may contain "example.com" whereas the Uri will be fully qualified eg "http://example.com/";.

    View Source

    Headers

    Gets a dictionary of Headers to append to the Response object.

    Declaration
    public IReadOnlyDictionary<string, string>? Headers { get; }
    Property Value
    Type Description
    System.Nullable<IReadOnlyDictionary<System.String, System.String>>
    View Source

    IgnorePublishedContentCollisions

    Gets a value indicating whether the Umbraco Backoffice should ignore a collision for this request.

    Declaration
    public bool IgnorePublishedContentCollisions { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    This is an uncommon API used for edge cases with complex routing and would be used by developers to configure the request to disable collision checks in .

    This flag is based on previous Umbraco versions but it is not clear how this flag can be set by developers since collission checking only occurs in the back office which is launched by for which events do not execute.

    More can be read about this setting here: https://github.com/umbraco/Umbraco-CMS/pull/2148, https://issues.umbraco.org/issue/U4-10345 but it's still unclear how this was used.

    View Source

    IsInternalRedirect

    Gets a value indicating whether the current published content has been obtained from the initial published content following internal redirections exclusively.

    Declaration
    public bool IsInternalRedirect { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Used by PublishedContentRequestEngine.FindTemplate() to figure out whether to apply the internal redirect or not, when content is not the initial content.

    View Source

    PublishedContent

    Gets a value indicating the requested content.

    Declaration
    public IPublishedContent PublishedContent { get; }
    Property Value
    Type Description
    IPublishedContent
    View Source

    RedirectUrl

    Gets the url to redirect to, when the content request triggers a redirect.

    Declaration
    public string RedirectUrl { get; }
    Property Value
    Type Description
    System.String
    View Source

    ResponseStatusCode

    Gets the content request http response status code.

    Declaration
    public int? ResponseStatusCode { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>
    Remarks

    Does not actually set the http response status code, only registers that the response should use the specified code. The code will or will not be used, in due time.

    View Source

    SetNoCacheHeader

    Gets a value indicating whether the no-cache value should be added to the Cache-Control header

    Declaration
    public bool SetNoCacheHeader { get; }
    Property Value
    Type Description
    System.Boolean
    View Source

    Template

    Gets the template assigned to the request (if any)

    Declaration
    public ITemplate Template { get; }
    Property Value
    Type Description
    ITemplate
    View Source

    Uri

    Gets the cleaned up inbound Uri used for routing.

    Declaration
    public Uri Uri { get; }
    Property Value
    Type Description
    Uri
    Remarks

    The cleaned up Uri has no virtual directory, no trailing slash, no .aspx extension, etc.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • PublishedRequest(Uri, String, IPublishedContent, Boolean, ITemplate, DomainAndUri, String, String, Nullable<Int32>, Nullable<IReadOnlyList<String>>, Nullable<IReadOnlyDictionary<String, String>>, Boolean, Boolean)
    • Properties
      • AbsolutePathDecoded
      • CacheExtensions
      • Culture
      • Domain
      • Headers
      • IgnorePublishedContentCollisions
      • IsInternalRedirect
      • PublishedContent
      • RedirectUrl
      • ResponseStatusCode
      • SetNoCacheHeader
      • Template
      • Uri
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX