Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http1: adds test with invalid status #2085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/http1-noint-status/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description

Test HTTP1 log of invalid status

https://redmine.openinfosecfoundation.org/issues/7311

# PCAP

The pcap is crafted with
`curl http://127.0.0.1:8001/test` as client
and custom server.py as server
Binary file added tests/http1-noint-status/input.pcap
Binary file not shown.
18 changes: 18 additions & 0 deletions tests/http1-noint-status/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /usr/bin/env python

# @author: Philippe Antoine

import sys
import binascii
from threading import Thread
import time
import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("127.0.0.1", 8001))
s.listen(1)
conn, addr = s.accept()
data = conn.recv(1024)
conn.send(b"HTTP/1.0 2XX OK\nServer: POC\nContent-Length:4\n\ntoto")
conn.close()
s.close()
13 changes: 13 additions & 0 deletions tests/http1-noint-status/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
requires:
min-version: 8

# disables checksum verification
args:
- -k none

checks:
- filter:
count: 1
match:
event_type: http
http.status_string: 2XX
Loading