Fix check for navigating upwards from http Paths

This commit is contained in:
Henrik Rydgård 2023-12-29 00:40:16 +01:00
parent cd00d06842
commit 755b2a2535

View file

@ -320,7 +320,7 @@ bool Path::CanNavigateUp() const {
}
if (type_ == PathType::HTTP) {
size_t rootSlash = path_.find_first_of('/', strlen("https://"));
if (rootSlash == path_.npos || path_.size() < rootSlash + 1) {
if (rootSlash == path_.npos || path_.size() == rootSlash + 1) {
// This means, "http://server" or "http://server/". Can't go up.
return false;
}