internal static bool HttpRoutesConflict(HttpTriggerBindingMetadata functionMetadata, HttpTriggerBindingMetadata otherFunctionMetadata)
{
if (string.Compare(functionMetadata.Route.Trim('/'), otherFunctionMetadata.Route.Trim('/'), StringComparison.OrdinalIgnoreCase) != 0)
{
// routes differ, so no conflict
return false;
}
if (functionMetadata.Methods == null || functionMetadata.Methods.Count == 0 ||
otherFunctionMetadata.Methods == null || otherFunctionMetadata.Methods.Count == 0)
{
// if either methods collection is null or empty that means
// "all methods", which will intersect with any method collection
return true;
}
return functionMetadata.Methods.Intersect(otherFunctionMetadata.Methods).Any();
}