Commit e8ee198a authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Check that DoH base URL does not already contain a `dns` query arg.

parent b98c9163
......@@ -23,6 +23,8 @@ endpoint_from_base(const std::string& base)
util::url_match um;
if (!util::match_http_url(base, um) || !um.fragment.empty())
return boost::none;
if (um.query.find("dns=") == 0 || um.query.find("&dns=") != std::string::npos)
return boost::none;
um.query += um.query.empty() ? "dns=" : "&dns=";
return um.reassemble();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment