C# Класс Universe.Framework.Utilities.UntrustedHttpWebRequest

Used for requests to untrusted endpoints that may potentially be malicious
Показать файл Открыть проект

Открытые методы

Метод Описание
Create ( Uri uri ) : HttpWebRequest

Creates an HttpWebRequest that is hardened against malicious endpoints after ensuring the given Uri is safe to retrieve

Create ( Uri uri, bool allowLoopback, int readWriteTimeoutMS, int timeoutMS, int maximumRedirects ) : HttpWebRequest

Creates an HttpWebRequest that is hardened against malicious endpoints after ensuring the given Uri is safe to retrieve

GetUntrustedUrl ( Uri url ) : string
PostToUntrustedUrl ( Uri url, string data ) : string

Приватные методы

Метод Описание
IsIPv6Loopback ( IPAddress ip ) : bool

Determines whether an IP address is the IPv6 equivalent of "localhost/127.0.0.1".

IsUriAllowable ( Uri uri, bool allowLoopback ) : bool

Determines whether a URI is allowed based on scheme and host name. No requireSSL check is done here

Описание методов

Create() публичный статический Метод

Creates an HttpWebRequest that is hardened against malicious endpoints after ensuring the given Uri is safe to retrieve
If uri is null If uri is unsafe
public static Create ( Uri uri ) : HttpWebRequest
uri System.Uri Web location to request
Результат System.Net.HttpWebRequest

Create() публичный статический Метод

Creates an HttpWebRequest that is hardened against malicious endpoints after ensuring the given Uri is safe to retrieve
If uri is null If uri is unsafe
public static Create ( Uri uri, bool allowLoopback, int readWriteTimeoutMS, int timeoutMS, int maximumRedirects ) : HttpWebRequest
uri System.Uri Web location to request
allowLoopback bool True to allow connections to localhost, otherwise false
readWriteTimeoutMS int Read write timeout, in milliseconds
timeoutMS int Connection timeout, in milliseconds
maximumRedirects int Maximum number of allowed redirects
Результат System.Net.HttpWebRequest

GetUntrustedUrl() публичный статический Метод

public static GetUntrustedUrl ( Uri url ) : string
url System.Uri
Результат string

PostToUntrustedUrl() публичный статический Метод

public static PostToUntrustedUrl ( Uri url, string data ) : string
url System.Uri
data string
Результат string