From ceda1ebc83d73810b9680114d6bcdeb79149bcb8 Mon Sep 17 00:00:00 2001 From: Pierce Date: Wed, 13 Sep 2023 17:23:52 -0400 Subject: [PATCH] dont log html urls if 0 urls present in data --- lua/cfc_http_restrictions/wraps/html.lua | 29 ++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/lua/cfc_http_restrictions/wraps/html.lua b/lua/cfc_http_restrictions/wraps/html.lua index d999a2b..5df0f8c 100644 --- a/lua/cfc_http_restrictions/wraps/html.lua +++ b/lua/cfc_http_restrictions/wraps/html.lua @@ -31,12 +31,15 @@ local function wrapHTMLPanel( panelName ) return url end ) - CFCHTTP.LogRequest( { - noisy = true, - method = "GET", - fileLocation = stack[3], - urls = logUrls, - } ) + + if #logUrls > 0 then + CFCHTTP.LogRequest( { + noisy = true, + method = "GET", + fileLocation = stack[3], + urls = logUrls, + } ) + end return _G[setHTML]( self, html, ... ) end @@ -57,12 +60,14 @@ local function wrapHTMLPanel( panelName ) return url end ) - CFCHTTP.LogRequest( { - noisy = true, - method = "GET", - fileLocation = stack[3], - urls = logUrls, - } ) + if #logUrls > 0 then + CFCHTTP.LogRequest( { + noisy = true, + method = "GET", + fileLocation = stack[3], + urls = logUrls, + } ) + end return _G[runJavascript]( self, js ) end