diff --git a/types/types.go b/types/types.go index 343ff51..6d2fcac 100644 --- a/types/types.go +++ b/types/types.go @@ -9,6 +9,10 @@ func intPtr(i int) *int { return &i } +func boolPtr(b bool) *bool { + return &b +} + func strPtr(s string) *string { return &s } @@ -29,17 +33,18 @@ var ( "Accept": "*/*", } exampleInput = Input{ - DestAddr: strPtr("192.168.0.1"), - Port: intPtr(8080), - Protocol: strPtr("http"), - URI: strPtr("/test"), - Version: strPtr("HTTP/1.1"), - Headers: exampleHeaders, - Method: strPtr("REPORT"), - Data: nil, - EncodedRequest: "TXkgRGF0YQo=", - SaveCookie: false, - StopMagic: false, + DestAddr: strPtr("192.168.0.1"), + Port: intPtr(8080), + Protocol: strPtr("http"), + URI: strPtr("/test"), + Version: strPtr("HTTP/1.1"), + Headers: exampleHeaders, + Method: strPtr("REPORT"), + Data: nil, + EncodedRequest: "TXkgRGF0YQo=", + SaveCookie: boolPtr(false), + StopMagic: boolPtr(true), + AutocompleteHeaders: boolPtr(false), } exampleOutput = Output{ Status: []int{200}, @@ -230,14 +235,22 @@ type Input struct { // examples: // - name: SaveCookie // value: 80 - SaveCookie bool `yaml:"save_cookie,omitempty" koanf:"save_cookie,omitempty"` + SaveCookie *bool `yaml:"save_cookie,omitempty" koanf:"save_cookie,omitempty"` + + // description: | + // StopMagic is deprecated. + // examples: + // - name: StopMagic + // value: false + StopMagic *bool `yaml:"stop_magic" koanf:"stop_magic,omitempty"` // description: | - // StopMagic allows you to declare which port on the destination host the tests should connect to. + // AutocompleteHeaders allows the test framework to automatically fill the request with Content-Type and Connection headers. + // Defaults to true. // examples: // - name: StopMagic // value: false - StopMagic bool `yaml:"stop_magic" koanf:"stop_magic,omitempty"` + AutocompleteHeaders *bool `yaml:"autocomplete_headers" koanf:"autocomplete_headers,omitempty"` // description: | // EncodedRequest allows you to declare which port on the destination host the tests should connect to.