Switch to new test harness
This commit is contained in:
@@ -25,21 +25,22 @@ func detectHTTPRequest(dir Direction, data []byte, srcPort, dstPort int) (proto
|
||||
confidence = -.1
|
||||
}
|
||||
|
||||
var (
|
||||
b = append(data, '\r', '\n')
|
||||
r = bufio.NewReader(bytes.NewReader(b))
|
||||
)
|
||||
if request, err := http.ReadRequest(r); err == nil {
|
||||
return &Protocol{
|
||||
Name: ProtocolHTTP,
|
||||
Version: Version{
|
||||
Major: request.ProtoMajor,
|
||||
Minor: request.ProtoMinor,
|
||||
Patch: -1,
|
||||
},
|
||||
}, confidence + .85
|
||||
}
|
||||
|
||||
if Strict {
|
||||
var (
|
||||
b = append(data, '\r', '\n')
|
||||
r = bufio.NewReader(bytes.NewReader(b))
|
||||
)
|
||||
if request, err := http.ReadRequest(r); err == nil {
|
||||
return &Protocol{
|
||||
Name: ProtocolHTTP,
|
||||
Version: Version{
|
||||
Major: request.ProtoMajor,
|
||||
Minor: request.ProtoMinor,
|
||||
Patch: -1,
|
||||
},
|
||||
}, confidence + .85
|
||||
}
|
||||
return nil, 0
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user