Fix JSON rendering of HTTP response audit
Populate the REST-API JSON response object when formatting
audit records in JSON.
Change-Id: I5db26bd0d520982a4334cd618460ac5926ff892f
diff --git a/src/main/java/com/googlesource/gerrit/plugins/auditsl4j/AuditRendererToJson.java b/src/main/java/com/googlesource/gerrit/plugins/auditsl4j/AuditRendererToJson.java
index 2ea29f3..df6a361 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/auditsl4j/AuditRendererToJson.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/auditsl4j/AuditRendererToJson.java
@@ -16,6 +16,7 @@
import com.google.common.collect.ListMultimap;
import com.google.gerrit.entities.Account;
+import com.google.gerrit.extensions.restapi.Response;
import com.google.gerrit.json.OutputFormat;
import com.google.gerrit.server.AccessPath;
import com.google.gerrit.server.AuditEvent;
@@ -58,6 +59,7 @@
&& !CurrentUser.class.isAssignableFrom(clazz)
&& !ListMultimap.class.isAssignableFrom(clazz)
&& !AuditEvent.UUID.class.isAssignableFrom(clazz)
+ && !Response.class.isAssignableFrom(clazz)
&& !WHITELIST_CLASSES.contains(clazz);
}
};