File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
src/ReCaptcha/RequestMethod
tests/ReCaptcha/RequestMethod Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function submit(RequestParameters $params)
81
81
82
82
$ content = $ params ->toQueryString ();
83
83
84
- $ request = "POST " . $ urlParsed ['path ' ] . " HTTP/1.1 \r\n" ;
84
+ $ request = "POST " . $ urlParsed ['path ' ] . " HTTP/1.0 \r\n" ;
85
85
$ request .= "Host: " . $ urlParsed ['host ' ] . "\r\n" ;
86
86
$ request .= "Content-Type: application/x-www-form-urlencoded \r\n" ;
87
87
$ request .= "Content-length: " . strlen ($ content ) . "\r\n" ;
@@ -97,7 +97,7 @@ public function submit(RequestParameters $params)
97
97
98
98
$ this ->socket ->fclose ();
99
99
100
- if (0 !== strpos ($ response , 'HTTP/1.1 200 OK ' )) {
100
+ if (0 !== strpos ($ response , 'HTTP/1.0 200 OK ' )) {
101
101
return '{"success": false, "error-codes": [" ' .ReCaptcha::E_BAD_RESPONSE .'"]} ' ;
102
102
}
103
103
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public function testSubmitSuccess()
53
53
->method ('fwrite ' );
54
54
$ socket ->expects ($ this ->once ())
55
55
->method ('fgets ' )
56
- ->willReturn ("HTTP/1.1 200 OK \n\nRESPONSEBODY " );
56
+ ->willReturn ("HTTP/1.0 200 OK \n\nRESPONSEBODY " );
57
57
$ socket ->expects ($ this ->exactly (2 ))
58
58
->method ('feof ' )
59
59
->will ($ this ->onConsecutiveCalls (false , true ));
@@ -81,7 +81,7 @@ public function testOverrideSiteVerifyUrl()
81
81
->with ($ this ->matchesRegularExpression ('/^POST \/some\/path.*Host: over\.ride/s ' ));
82
82
$ socket ->expects ($ this ->once ())
83
83
->method ('fgets ' )
84
- ->willReturn ("HTTP/1.1 200 OK \n\nRESPONSEBODY " );
84
+ ->willReturn ("HTTP/1.0 200 OK \n\nRESPONSEBODY " );
85
85
$ socket ->expects ($ this ->exactly (2 ))
86
86
->method ('feof ' )
87
87
->will ($ this ->onConsecutiveCalls (false , true ));
@@ -107,7 +107,7 @@ public function testSubmitBadResponse()
107
107
->method ('fwrite ' );
108
108
$ socket ->expects ($ this ->once ())
109
109
->method ('fgets ' )
110
- ->willReturn ("HTTP/1.1 500 NOPEn \\nBOBBINS " );
110
+ ->willReturn ("HTTP/1.0 500 NOPEn \\nBOBBINS " );
111
111
$ socket ->expects ($ this ->exactly (2 ))
112
112
->method ('feof ' )
113
113
->will ($ this ->onConsecutiveCalls (false , true ));
You can’t perform that action at this time.
0 commit comments