C# Класс Headless.RelaxedFolderLocationValidator

The RelaxedFolderLocationValidator class uses relaxed rules for validating locations using Uri.GetComponents.
In addition to ignoring query strings and running case insensitive validations, this class also automatically appends trailing slashes to paths that appear to represent folders before running validation. This fixes validation issues where http://test.com/testing does not match http://test.com/testing/ where the server is likely to interpret the two as the same resource.
Наследование: ComponentsLocationValidator
Показать файл Открыть проект

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

Метод Описание
Matches ( Uri location, Uri expectedLocation ) : bool This method appends a forward slash character to the path part of each Uri where the path appears to be a folder reference that lacks a trailing forward slash. This fixes validation issues where http://test.com/testing does not match http://test.com/testing/ where the server is likely to interpret the two as the same resource.
RelaxedFolderLocationValidator ( ) : System

Initializes a new instance of the RelaxedFolderLocationValidator class.

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

Метод Описание
MakeSafeFolderLocation ( Uri location ) : Uri

Makes the safe folder location.

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

Matches() публичный Метод

This method appends a forward slash character to the path part of each Uri where the path appears to be a folder reference that lacks a trailing forward slash. This fixes validation issues where http://test.com/testing does not match http://test.com/testing/ where the server is likely to interpret the two as the same resource.
/// The parameter is null. /// /// The is a relative location where an absolute location is required. /// /// The parameter is null. /// /// The is a relative location where an absolute location is required. ///
public Matches ( Uri location, Uri expectedLocation ) : bool
location System.Uri
expectedLocation System.Uri
Результат bool

RelaxedFolderLocationValidator() публичный Метод

Initializes a new instance of the RelaxedFolderLocationValidator class.
public RelaxedFolderLocationValidator ( ) : System
Результат System