@@ -140,17 +140,18 @@ func TestHTTP(t *testing.T) {
140140 host , port , _ := net .SplitHostPort (u .Host )
141141
142142 testOk := func () {
143- opts , err := parseArgs ([]string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.1 \r\n\r\n` , "-E" , "-e" , "OKOK" })
143+ opts , err := parseArgs ([]string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.0 \r\n\r\n` , "-E" , "-e" , "OKOK" })
144144 assert .Equal (t , nil , err , "no errors" )
145145 ckr := opts .run ()
146+ fmt .Println (ckr )
146147 assert .Equal (t , checkers .OK , ckr .Status , "should be OK" )
147148 assert .Regexp (t , `seconds response time on` , ckr .Message , "Unexpected response" )
148149 }
149150 testOk ()
150151
151152 testUnexpected := func () {
152153 opts , err := parseArgs (
153- []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.1 \r\n\r\n` , "-E" , "-e" , "OKOKOK" })
154+ []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.0 \r\n\r\n` , "-E" , "-e" , "OKOKOK" })
154155 assert .Equal (t , nil , err , "no errors" )
155156 ckr := opts .run ()
156157 assert .Equal (t , checkers .CRITICAL , ckr .Status , "should be CRITICAL" )
@@ -160,7 +161,7 @@ func TestHTTP(t *testing.T) {
160161
161162 testOverWarn := func () {
162163 opts , err := parseArgs (
163- []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.1 \r\n\r\n` , "-E" , "-e" , "OKOK" , "-w" , "0.1" })
164+ []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.0 \r\n\r\n` , "-E" , "-e" , "OKOK" , "-w" , "0.1" })
164165 assert .Equal (t , nil , err , "no errors" )
165166 ckr := opts .run ()
166167 assert .Equal (t , checkers .WARNING , ckr .Status , "should be Warning" )
@@ -170,7 +171,7 @@ func TestHTTP(t *testing.T) {
170171
171172 testOverCrit := func () {
172173 opts , err := parseArgs (
173- []string {"-H" , host , "-p" , port , "--send" , "GET / HTTP/1.1 \r \n \r \n " , "-e" , "OKOK" , "-c" , "0.1" })
174+ []string {"-H" , host , "-p" , port , "--send" , "GET / HTTP/1.0 \r \n \r \n " , "-e" , "OKOK" , "-c" , "0.1" })
174175 assert .Equal (t , nil , err , "no errors" )
175176 ckr := opts .run ()
176177 assert .Equal (t , checkers .CRITICAL , ckr .Status , "should be Critical" )
@@ -275,7 +276,7 @@ func TestHTTPIPv6(t *testing.T) {
275276 }()
276277
277278 testOk := func () {
278- opts , err := parseArgs ([]string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.1 \r\n\r\n` , "-E" , "-e" , "OKOK" })
279+ opts , err := parseArgs ([]string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.0 \r\n\r\n` , "-E" , "-e" , "OKOK" })
279280 assert .Equal (t , nil , err , "no errors" )
280281 ckr := opts .run ()
281282 assert .Equal (t , checkers .OK , ckr .Status , "should be OK" )
@@ -285,7 +286,7 @@ func TestHTTPIPv6(t *testing.T) {
285286
286287 testUnexpected := func () {
287288 opts , err := parseArgs (
288- []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.1 \r\n\r\n` , "-E" , "-e" , "OKOKOK" })
289+ []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.0 \r\n\r\n` , "-E" , "-e" , "OKOKOK" })
289290 assert .Equal (t , nil , err , "no errors" )
290291 ckr := opts .run ()
291292 assert .Equal (t , checkers .CRITICAL , ckr .Status , "should be CRITICAL" )
@@ -295,7 +296,7 @@ func TestHTTPIPv6(t *testing.T) {
295296
296297 testOverWarn := func () {
297298 opts , err := parseArgs (
298- []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.1 \r\n\r\n` , "-E" , "-e" , "OKOK" , "-w" , "0.1" })
299+ []string {"-H" , host , "-p" , port , "--send" , `GET / HTTP/1.0 \r\n\r\n` , "-E" , "-e" , "OKOK" , "-w" , "0.1" })
299300 assert .Equal (t , nil , err , "no errors" )
300301 ckr := opts .run ()
301302 assert .Equal (t , checkers .WARNING , ckr .Status , "should be Warning" )
@@ -305,7 +306,7 @@ func TestHTTPIPv6(t *testing.T) {
305306
306307 testOverCrit := func () {
307308 opts , err := parseArgs (
308- []string {"-H" , host , "-p" , port , "--send" , "GET / HTTP/1.1 \r \n \r \n " , "-e" , "OKOK" , "-c" , "0.1" })
309+ []string {"-H" , host , "-p" , port , "--send" , "GET / HTTP/1.0 \r \n \r \n " , "-e" , "OKOK" , "-c" , "0.1" })
309310 assert .Equal (t , nil , err , "no errors" )
310311 ckr := opts .run ()
311312 assert .Equal (t , checkers .CRITICAL , ckr .Status , "should be Critical" )
0 commit comments