Class UmbracoRequestPaths
Utility for checking paths
Inheritance
Namespace: Umbraco.Cms.Core.Routing
Assembly: Umbraco.Core.dll
Syntax
public class UmbracoRequestPaths
Constructors
View SourceUmbracoRequestPaths(IHostingEnvironment, IOptions<UmbracoRequestPathsOptions>)
Declaration
[Obsolete("Please use the constructor that accepts all arguments. Scheduled for removal in Umbraco 19.")]
public UmbracoRequestPaths(IHostingEnvironment hostingEnvironment, IOptions<UmbracoRequestPathsOptions> umbracoRequestPathsOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostingEnvironment | hostingEnvironment | |
| IOptions<UmbracoRequestPathsOptions> | umbracoRequestPathsOptions |
UmbracoRequestPaths(IHostingEnvironment, IOptions<UmbracoRequestPathsOptions>, IOptions<DeliveryApiSettings>)
Initializes a new instance of the UmbracoRequestPaths class.
Declaration
public UmbracoRequestPaths(IHostingEnvironment hostingEnvironment, IOptions<UmbracoRequestPathsOptions> umbracoRequestPathsOptions, IOptions<DeliveryApiSettings> deliveryApiSettings)
Parameters
| Type | Name | Description |
|---|---|---|
| IHostingEnvironment | hostingEnvironment | |
| IOptions<UmbracoRequestPathsOptions> | umbracoRequestPathsOptions | |
| IOptions<DeliveryApiSettings> | deliveryApiSettings |
Methods
View SourceIsBackOfficeRequest(string)
Checks if the current uri is a back office request
Declaration
public bool IsBackOfficeRequest(string absPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | absPath |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
There are some special routes we need to check to properly determine this:
These are def back office: /Umbraco/BackOffice = back office /Umbraco/Preview = back office /Umbraco/Management/Api = back office
If it's not any of the above then we cannot determine if it's back office or front-end so we can only assume that it is not back office.
These are def front-end: /Umbraco/Surface = front-end /Umbraco/Api = front-end But if we've got this far we'll just have to assume it's front-end anyways.
IsClientSideRequest(string)
Rudimentary check to see if it's not a server side request
Declaration
public bool IsClientSideRequest(string absPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | absPath |
Returns
| Type | Description |
|---|---|
| bool |
IsInstallerRequest(string)
Checks if the current uri is an install request
Declaration
public bool IsInstallerRequest(string absPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | absPath |
Returns
| Type | Description |
|---|---|
| bool |