Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Remi Gacogne <[email protected]>
  • Loading branch information
omoerbeek and rgacogne authored Feb 12, 2025
1 parent 25c8beb commit ea0f93a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pdns/recursordist/rec-rust-lib/rust/src/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ fn api_wrapper(
if !auth_ok {
for kv in &request.vars {
cxx::let_cxx_string!(s = &kv.value);
if kv.key == "x-api-key" && ctx.api_ch.as_ref().unwrap().matches(&s) {
if kv.key == "api-key" && ctx.api_ch.as_ref().unwrap().matches(&s) {
auth_ok = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion pdns/recursordist/ws-recursor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ static void rustWrapper(const std::function<void(HttpRequest*, HttpResponse*)>&
request.parameters[std::string(key)] = std::string(value);
}
// These two log objects are not used by the Rust code, as they take the logging object from the
// context, initalized from an argument to pdns::rust::web::rec::serveweb()
// context, initialized from an argument to pdns::rust::web::rec::serveweb()
request.d_slog = g_slog;
response.d_slog = g_slog;
try {
Expand Down
2 changes: 1 addition & 1 deletion regression-tests.api/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def finalize_server():
if daemon == 'authoritative':
res = requests.get('http://127.0.0.1:%s/' % WEBPORT)
else:
res = requests.get('https://127.0.0.1:%s/' % WEBPORT, verify=False)
res = requests.get('https://127.0.0.1:%s/' % WEBPORT, verify='ca.pem')
available = True
break
except HTTPError as http_err:
Expand Down
2 changes: 1 addition & 1 deletion regression-tests.api/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setUp(self):
self.session.headers = {'X-API-Key': os.environ.get('APIKEY', 'changeme-key'), 'Origin': 'http://%s:%s' % (self.server_address, self.server_port)}
if is_recursor():
self.server_url = 'https://%s:%s/' % (self.server_address, self.server_port)
self.session.verify = False
self.session.verify = 'ca.pem'

def url(self, relative_url):
return urljoin(self.server_url, relative_url)
Expand Down
2 changes: 1 addition & 1 deletion regression-tests.recursor-dnssec/test_Prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def generateRecursorConfig(cls, confdir):
def testPrometheus(self):
self.waitForTCPSocket("127.0.0.1", self._wsPort)
url = 'https://user:' + self._wsPassword + '@127.0.0.1:' + str(self._wsPort) + '/metrics'
r = requests.get(url, timeout=self._wsTimeout, verify=False)
r = requests.get(url, timeout=self._wsTimeout, verify='ca.pem')
self.assertTrue(r)
self.assertEqual(r.status_code, 200)
self.checkPrometheusContentBasic(r.text)
Expand Down

0 comments on commit ea0f93a

Please sign in to comment.