Skip to content

Insufficient handling of HTTP 100 status #62

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

Open
hschletz opened this issue Nov 21, 2016 · 1 comment
Open

Insufficient handling of HTTP 100 status #62

hschletz opened this issue Nov 21, 2016 · 1 comment
Labels

Comments

@hschletz
Copy link
Contributor

I get this warning for some methods called via Client::sendRequest():

Notice: Undefined index: label in [...]/tivoka/lib/Tivoka/Client/Request.php on line 99
Notice: Undefined index: body in [...]/tivoka/lib/Tivoka/Client/Request.php on line 99

The code removes the first line of the $headers parameter and assumes the rest will match. However, the offending input looks like this:

array (size=7)
  0 => string 'HTTP/1.1 100 Continue' (length=21)
  1 => string 'HTTP/1.1 200 OK' (length=15)
  2 => string 'Date: Mon, 21 Nov 2016 11:44:46 GMT' (length=35)
  3 => string 'Server: Apache/2.4.10 (Debian)' (length=30)
  4 => string 'Content-Length: 144' (length=19)
  5 => string 'Connection: close' (length=17)
  6 => string 'Content-Type: application/json' (length=30)

The code needs a better detection of status lines to handle the case of the 100/200 status.

@marcelklehr
Copy link
Owner

Bug confirmed. Will fix ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants