Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
UE::Core::FURLRequestFilter Class Reference

#include <URLRequestFilter.h>

+ Collaboration diagram for UE::Core::FURLRequestFilter:

Public Types

using FRequestMap = TMap<const FString, const TArray<FString>>
 

Public Member Functions

 FURLRequestFilter ()=default
 
 FURLRequestFilter (const TCHAR *ConfigSectionRootName, const FString &ConfigFileName)
 
 FURLRequestFilter (const FRequestMap &InAllowedRequests)
 
 FURLRequestFilter (FRequestMap &&InAllowedRequests)
 
bool IsRequestAllowed (FStringView InURL) const
 

Private Attributes

FRequestMap AllowedRequests
 

Detailed Description

A filter that can used to restrict URL schemes and domains to known-safe values. Stores a map of schemes to domains: if the map is empty, no filtering is performed and any URL is allowed. Each key is a scheme (such as "https"). If a scheme is present, it will be allowed. Each value is an array of absolute domains or partial higher-level domains that are allowed for their scheme.

Absolute domains do not start with a period and will be matched exactly with domains from the input URL, for example, "epicgames.com".

Partial domains start with a period and will be matched with the ending of the input domain. Use these to allow all subdomains of the higher-level domain. For example, ".epicgames.com"

To allow both an absolute domain and all of its subdomains, provide two entries in the array, one with the period prefix and one without. For example, "epicgames.com" and ".epicgames.com".

Definition at line 28 of file URLRequestFilter.h.

Member Typedef Documentation

◆ FRequestMap

Constructor & Destructor Documentation

◆ FURLRequestFilter() [1/4]

UE::Core::FURLRequestFilter::FURLRequestFilter ( )
default

◆ FURLRequestFilter() [2/4]

UE::Core::FURLRequestFilter::FURLRequestFilter ( const TCHAR * ConfigSectionRootName,
const FString & ConfigFileName )

Initializes the allowlist map based on ini configs. Example syntax:

[ConfigSectionRootName https] !AllowedDomains=ClearArray +AllowedDomains=epicgames.com

[ConfigSectionRootName http] !AllowedDomains=ClearArray +AllowedDomains=epicgames.com

◆ FURLRequestFilter() [3/4]

UE::Core::FURLRequestFilter::FURLRequestFilter ( const FRequestMap & InAllowedRequests)

Initializes the allowlist based on an explicit scheme/domain map

◆ FURLRequestFilter() [4/4]

UE::Core::FURLRequestFilter::FURLRequestFilter ( FRequestMap && InAllowedRequests)

Member Function Documentation

◆ IsRequestAllowed()

bool UE::Core::FURLRequestFilter::IsRequestAllowed ( FStringView InURL) const

Matches InURL against the configued list of allowed URL schemes and domains. Returns true if the URL is allowed.

Member Data Documentation

◆ AllowedRequests

FRequestMap UE::Core::FURLRequestFilter::AllowedRequests
private

Definition at line 60 of file URLRequestFilter.h.


The documentation for this class was generated from the following file: