----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/64574/#review196087 -----------------------------------------------------------
Fix it, then Ship it! Approach looks good to me! A couple of suggestions: (1) Can you update the description to reflect the updated approach? Specifically, disallowing route() calls from using a trailing slash? (2) Would be nice for the commit summary to reflect this is about libprocess routing (as opposed to say, some other component that touches URLs): ``` Updated libprocess routing to treat trailing '/' as insignificant. ``` (3) Might be nice to split the tests out into a separate patch to make it so that if we cherry-pick it's easier to choose whether we cherry-pick back the tests. 3rdparty/libprocess/src/process.cpp Lines 3551 (patched) <https://reviews.apache.org/r/64574/#comment275600> A little more context here would be helpful for the reader: ``` We enforce that routes for ".../path" are resolved when the user provides a trailing slash ".../path/". The trailing slash is stripped here in order to accomplish this. ``` 3rdparty/libprocess/src/process.cpp Lines 3746-3748 (patched) <https://reviews.apache.org/r/64574/#comment275601> Can you document this at the API level? https://github.com/apache/mesos/blob/9e18db59f75b85fc6467272203366eef1c17233e/3rdparty/libprocess/include/process/process.hpp#L270-L275 3rdparty/libprocess/src/tests/http_tests.cpp Line 260 (original), 264 (patched) <https://reviews.apache.org/r/64574/#comment275602> A little more context here about the semantics provided by libprocess' routing would be helpful. - Benjamin Mahler On Jan. 18, 2018, 5:46 p.m., Alexander Rukletsov wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/64574/ > ----------------------------------------------------------- > > (Updated Jan. 18, 2018, 5:46 p.m.) > > > Review request for mesos, Benjamin Bannier and Benjamin Mahler. > > > Bugs: MESOS-5333 > https://issues.apache.org/jira/browse/MESOS-5333 > > > Repository: mesos > > > Description > ------- > > Prior to this patch, adding a trailing '/' to a valid URL path, e.g., > "/state/", yielded a 404 response. This patch ensures that two URLs > which differ only in trailing '/' produce the same result. > > > Diffs > ----- > > 3rdparty/libprocess/src/process.cpp > 2126c272a69bfa53b4b3cbbb1a55a3f81a5da8ad > 3rdparty/libprocess/src/tests/http_tests.cpp > f79d366baecc73e6b14df593a906264f5fd1d72b > > > Diff: https://reviews.apache.org/r/64574/diff/2/ > > > Testing > ------- > > Ensured the modified test fails without the fix. > `make check` on Mac OS 10.11.6 and several Linux distributions. > > > Thanks, > > Alexander Rukletsov > >
