blob: 923e1471ce26ad9136e6177582c28509593730bd [file] [log] [blame]
Andrew Geissler3b025e62019-02-01 10:33:54 -06001#include "processing.hpp"
2
3#include <boost/algorithm/string/predicate.hpp>
4
5bool getWellKnown(
6 const boost::container::flat_map<std::string, std::string>& owners,
7 const std::string& request, std::string& wellKnown)
8{
9 // If it's already a well known name, just return
10 if (!boost::starts_with(request, ":"))
11 {
12 wellKnown = request;
13 return true;
14 }
15
16 auto it = owners.find(request);
17 if (it == owners.end())
18 {
19 return false;
20 }
21 wellKnown = it->second;
22 return true;
23}