]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/http: add location header independent of status availability 10134/head
authorVictor Julien <vjulien@oisf.net>
Mon, 8 Jan 2024 08:02:46 +0000 (09:02 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 8 Jan 2024 19:23:29 +0000 (20:23 +0100)
src/output-json-http.c

index e49eb5e8a74e82fcc74be51d80ba188960d0faa4..abbeaf07edb68e8e8f2d80b156f5ab7f10249f8d 100644 (file)
@@ -301,12 +301,12 @@ static void EveHttpLogJSONExtended(JsonBuilder *js, htp_tx_t *tx)
                 status_string, status_size);
         unsigned int val = strtoul(status_string, NULL, 10);
         jb_set_uint(js, "status", val);
+    }
 
-        htp_header_t *h_location = htp_table_get_c(tx->response_headers, "location");
-        if (h_location != NULL) {
-            jb_set_string_from_bytes(
-                    js, "redirect", bstr_ptr(h_location->value), bstr_len(h_location->value));
-        }
+    htp_header_t *h_location = htp_table_get_c(tx->response_headers, "location");
+    if (h_location != NULL) {
+        jb_set_string_from_bytes(
+                js, "redirect", bstr_ptr(h_location->value), bstr_len(h_location->value));
     }
 
     /* length */