--- /dev/null
+# Description
+
+Test http2 file extraction over multiple transactions with range header.
+# PCAP
+
+The pcap comes from running dummy HTTP1 and HTTP2 server with `go run server.go` with an eicar.txt file in the current directory containing the eicar file
+and in parallel as client(s) :
+```
+curl -H 'Range: bytes=0-10' --http2 127.0.0.1:8080/eicar
+curl -H 'Range: bytes=10-20' 127.0.0.1:8080/eicar
+curl -H 'Range: bytes=20-30' --http2 127.0.0.1:8080/eicar
+curl -H 'Range: bytes=30-40' 127.0.0.1:8080/eicar
+curl -H 'Range: bytes=40-68' --http2 127.0.0.1:8080/eicar
+```
--- /dev/null
+package main
+
+import (
+ "fmt"
+ "golang.org/x/net/http2"
+ "golang.org/x/net/http2/h2c"
+ "net/http"
+)
+
+func main() {
+ h2s := &http2.Server{}
+
+ handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "eicar.txt")
+ })
+
+ server := &http.Server{
+ Addr: "0.0.0.0:8080",
+ Handler: h2c.NewHandler(handler, h2s),
+ }
+
+ fmt.Printf("Listening [0.0.0.0:8080]...\n")
+ err := server.ListenAndServe()
+ fmt.Printf("lol %s", err)
+}
--- /dev/null
+requires:
+ features:
+ - HAVE_LIBJANSSON
+ min-version: 7.0.0
+
+# disables checksum verification
+args:
+ - -k none --set app-layer.protocols.http2.enabled=true
+
+checks:
+
+ # Check that there is one file event with total length.
+ - filter:
+ count: 1
+ match:
+ event_type: fileinfo
+ fileinfo.size: 69
+ - filter:
+ count: 0
+ match:
+ event_type: anomaly