You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->addTrace(sprintf('Method "%s" does not match any of the required methods (%s)', $this->context->getMethod(), implode(', ', $requiredMethods)), self::ROUTE_ALMOST_MATCHES, $name, $route);
120
+
continue;
121
+
}
122
+
83
123
$hostMatches = [];
84
124
if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) {
85
125
$this->addTrace(sprintf('Host "%s" does not match the requirement ("%s")', $this->context->getHost(), $route->getHost()), self::ROUTE_ALMOST_MATCHES, $name, $route);
86
-
87
126
continue;
88
127
}
89
128
90
-
// check HTTP method requirement
91
-
if ($requiredMethods = $route->getMethods()) {
92
-
// HEAD and GET are equivalent as per RFC
93
-
if ('HEAD' === $method = $this->context->getMethod()) {
$this->addTrace(sprintf('Method "%s" does not match any of the required methods (%s)', $this->context->getMethod(), implode(', ', $requiredMethods)), self::ROUTE_ALMOST_MATCHES, $name, $route);
101
-
102
-
continue;
131
+
if (self::REQUIREMENT_MISMATCH === $status[0]) {
132
+
if ($route->getCondition()) {
133
+
$this->addTrace(sprintf('Condition "%s" does not evaluate to "true"', $route->getCondition()), self::ROUTE_ALMOST_MATCHES, $name, $route);
134
+
} else {
135
+
$this->addTrace(sprintf('Scheme "%s" does not match any of the required schemes (%s); the user will be redirected to first required scheme', $this->getContext()->getScheme(), implode(', ', $route->getSchemes())), self::ROUTE_ALMOST_MATCHES, $name, $route);
$this->addTrace(sprintf('Condition "%s" does not evaluate to "true"', $condition), self::ROUTE_ALMOST_MATCHES, $name, $route);
110
137
111
-
continue;
112
-
}
138
+
continue;
113
139
}
114
140
115
-
// check HTTP scheme requirement
116
-
if ($requiredSchemes = $route->getSchemes()) {
117
-
$scheme = $this->context->getScheme();
118
-
119
-
if (!$route->hasScheme($scheme)) {
120
-
$this->addTrace(sprintf('Scheme "%s" does not match any of the required schemes (%s); the user will be redirected to first required scheme', $scheme, implode(', ', $requiredSchemes)), self::ROUTE_ALMOST_MATCHES, $name, $route);
$this->addTrace(sprintf('Method "%s" does not match any of the required methods (%s)', $this->context->getMethod(), implode(', ', $requiredMethods)), self::ROUTE_ALMOST_MATCHES, $name, $route);
0 commit comments