ooni-probe-cli/nettests/middlebox/http_header_field_manipulation.go
Arturo Filastò 0c5b6aa37c Rename gooni to probe-cli
This is the command I used:
```
rg 'github.com/openobservatory/gooni' --files-with-matches \
    | xargs sed -i '' 's/github.com\/openobservatory\/gooni/github.com\/ooni\/probe-cli/g'
```
2018-05-03 14:59:55 +02:00

44 lines
1.0 KiB
Go

package middlebox
import (
"github.com/measurement-kit/go-measurement-kit"
"github.com/ooni/probe-cli/nettests"
)
// HTTPHeaderFieldManipulation test implementation
type HTTPHeaderFieldManipulation struct {
}
// Run starts the test
func (h HTTPHeaderFieldManipulation) Run(ctl *nettests.Controller) error {
mknt := mk.NewNettest("HttpHeaderFieldManipulation")
ctl.Init(mknt)
return mknt.Run()
}
// HTTPHeaderFieldManipulationSummary for the test
type HTTPHeaderFieldManipulationSummary struct {
Tampering bool
}
// Summary generates a summary for a test run
func (h HTTPHeaderFieldManipulation) Summary(tk map[string]interface{}) interface{} {
tampering := false
for _, v := range tk["tampering"].(map[string]interface{}) {
t, ok := v.(bool)
// Ignore non booleans in the tampering map
if ok && t == true {
tampering = true
}
}
return HTTPHeaderFieldManipulationSummary{
Tampering: tampering,
}
}
// LogSummary writes the summary to the standard output
func (h HTTPHeaderFieldManipulation) LogSummary(s string) error {
return nil
}