-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: [CURLRequest] Multiple HTTP 100 return by API #8347
Labels
bug
Verified issues on the current code behavior or pull requests that will fix them
Comments
PhpEssential
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Dec 19, 2023
kenjis
changed the title
Bug: Multiple HTTP 100 return by API
Bug: [CURLRequest] Multiple HTTP 100 return by API
Dec 23, 2023
Your fix makes an existing test fail. How about this? --- a/system/HTTP/CURLRequest.php
+++ b/system/HTTP/CURLRequest.php
@@ -389,7 +389,7 @@ class CURLRequest extends OutgoingRequest
// Set the string we want to break our response from
$breakString = "\r\n\r\n";
- if (strpos($output, 'HTTP/1.1 100 Continue') === 0) {
+ while (strpos($output, 'HTTP/1.1 100 Continue') === 0) {
$output = substr($output, strpos($output, $breakString) + 4);
}
|
kenjis
added
the
waiting for info
Issues or pull requests that need further clarification from the author
label
Dec 25, 2023
Off topic, I have prepared the reproduction code and set up the flask server.
|
$ curl -v https://codeigniter.com |
5 tasks
@ping-yee Great! |
Ok thanks ! In my case the flask call another api, maybe it's the way to reproduce |
kenjis
removed
the
waiting for info
Issues or pull requests that need further clarification from the author
label
Feb 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PHP Version
8.1
CodeIgniter4 Version
4.4.2
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Windows, Linux
Which server did you use?
apache
Database
No response
What happened?
When I call API built with a Flask server, this one return these headers:
HTTP/1.1 100 Continue
HTTP/1.1 100 Continue
HTTP/1.1 500 INTERNAL SERVER ERROR
Server: Werkzeug/2.2.3 Python/3.7.16
Date: Tue, 19 Dec 2023 21:30:20 GMT
Content-Type: application/json
Content-Length: 403
Access-Control-Allow-Origin: *
Connection: close
In this case the CURLRequest class doesn't parse correctlly the headers
Steps to Reproduce
Make POST API with Flask 2.2.5 in debug mode and call it via CURLRequest
Expected Output
In this case status code should be 500 not 100
Anything else?
Just change this:
By this:
at line 392
For others who have the problem, actually I overwrite the class and specially the function send in my project and instanciate it via this function in Config\Service:
The text was updated successfully, but these errors were encountered: