util/UriRelative: allow "parent" to end with slash

This commit is contained in:
Max Kellermann 2019-09-07 23:27:07 +02:00
parent 2574615fa3
commit 58363cf4dd

View File

@ -44,8 +44,8 @@ uri_is_child(const char *parent, const char *child) noexcept
#endif
const char *suffix = StringAfterPrefix(child, parent);
return suffix != nullptr &&
*suffix == '/';
return suffix != nullptr && *suffix != 0 &&
(suffix == child || suffix[-1] == '/' || *suffix == '/');
}