#include "utils.h"

#include <util/string/builder.h>
#include <util/string/cast.h>

namespace NModFlagsGetter {

    TString JoinFlagsPath(const TString& flagsPath, TString url) {
        if (auto pos = url.find_first_of("?#"); pos != TString::npos) {
            url.remove(pos);
        }

        if (!url || url[0] != '/') {
            url.prepend('/');
        }

        return flagsPath + url;
    }
}
