#include "nameextractors.h"

TString TServiceNameExtractor::ExtractServiceName(const TCgiParameters& cgi) {
    const size_t cgiCount = cgi.NumOfValues(NSearchProxyCgi::service);

    if (cgiCount > 1) {
        throw TSearchException(HTTP_BAD_REQUEST, yxINCOMPATIBLE_REQ_PARAMS) << "More than one 'service' cgi parameters are present";
    }

    return cgi.Get(NSearchProxyCgi::service);
}
