summaryrefslogtreecommitdiffstats
path: root/src/processing.cpp
blob: 923e1471ce26ad9136e6177582c28509593730bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "processing.hpp"

#include <boost/algorithm/string/predicate.hpp>

bool getWellKnown(
    const boost::container::flat_map<std::string, std::string>& owners,
    const std::string& request, std::string& wellKnown)
{
    // If it's already a well known name, just return
    if (!boost::starts_with(request, ":"))
    {
        wellKnown = request;
        return true;
    }

    auto it = owners.find(request);
    if (it == owners.end())
    {
        return false;
    }
    wellKnown = it->second;
    return true;
}
OpenPOWER on IntegriCloud