Benno Evers created MESOS-9652:
----------------------------------
Summary: URL handler lookup might miss root handlers
Key: MESOS-9652
URL: https://issues.apache.org/jira/browse/MESOS-9652
Project: Mesos
Issue Type: Bug
Reporter: Benno Evers
When looking up url handlers, libprocess is looking for the longest URL prefix
that corresponds to a http endpoint handler registered by the handling process.
For example if a process did setup route `/foo` and `/foo/bar`, an incoming
http request for `/foo/bar/baz` would be dispatched onto the `/foo/bar` handler.
However, if a process registers a route `/` the lookup will only succeed if the
request is exactly for `/`, and a request for `/baz` will return a 404 Not
Found response.
The root cause of this is the implementation of the handler lookup:
{noformat}
// ProcessBase::consume(HttpEvent&&)
name = strings::trim(name, strings::PREFIX, "/");
[...]
while (Path(name, '/').dirname() != name) {
[...]
}
{noformat}
where `dirname()` returns "." when given an input string that does not contain
any `/` as `name`.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)