Skip to content

Commit

Permalink
Firewall: Log Files: Live View - lookup hostnames may result in http …
Browse files Browse the repository at this point in the history
…431 ( Request Header Fields Too Large ). Split requests in cycles of 50, closes #6139
  • Loading branch information
AdSchellevis committed Nov 16, 2022
1 parent e85f1d7 commit da9c21c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/opnsense/mvc/app/views/OPNsense/Diagnostics/fw_log.volt
Expand Up @@ -45,9 +45,15 @@
*/
function reverse_lookup() {
let to_fetch = [];
let unfinshed_lookup = false;
$(".address").each(function(){
let address = $(this).data('address');
if (!hostnameMap.hasOwnProperty(address) && !to_fetch.includes(address)) {
// limit dns fetches to 50 per cycle
if (to_fetch.length >= 50) {
unfinshed_lookup = true;
return;
}
to_fetch.push(address);
}
});
Expand All @@ -71,6 +77,10 @@
hostnameMap[address] = data[address];
}
});
if (unfinshed_lookup) {
// schedule next fetch
reverse_lookup();
}
update_grid();
});
} else {
Expand Down

0 comments on commit da9c21c

Please sign in to comment.