This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 972616cf workround for logparser crash
972616cf is described below

commit 972616cf061495d7b746b26db6e8cee4a05dcb4f
Author: Sebb <[email protected]>
AuthorDate: Sat Mar 14 20:57:07 2026 +0000

    workround for logparser crash
---
 lib/whimsy/logparser.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/logparser.rb b/lib/whimsy/logparser.rb
index f0019f9d..a895fcd8 100755
--- a/lib/whimsy/logparser.rb
+++ b/lib/whimsy/logparser.rb
@@ -78,7 +78,8 @@ module LogParser
   # @param f filename of whimsy_access.log or .gz
   # @return array of reduced, scrubbed entries as hashes
   def parse_whimsy_access(f)
-    access = read_logz(f).scan(/<%JSON:apache_access%> (\{.*\})/).flatten
+    # HACK: gsub work round invalid JSON for NBSP in log files
+    access = read_logz(f).gsub('\xc2\xa0',' ').scan(/<%JSON:apache_access%> 
(\{.*\})/).flatten
     logs = JSON.parse('[' + access.join(',') + ']').reject do |i|
       (i['useragent'] =~ /Ping My Box/) || (i['uri'] =~ 
Regexp.union(IGNORED_URIS)) || (i['status'] == 304)
     end

Reply via email to