Headless.RelaxedFolderLocationValidator.Matches C# (CSharp) Method

Matches() public method

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
return bool
        public override bool Matches(Uri location, Uri expectedLocation)
        {
            ValidateParameters(expectedLocation, location);

            var convertedExpected = MakeSafeFolderLocation(expectedLocation);
            var convertedActual = MakeSafeFolderLocation(location);

            return base.Matches(convertedActual, convertedExpected);
        }