|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-09-10 19:03 UTC] bwoebi@php.net
Description: ------------ The built-in server can truncate headers if they span over a TCP packet boundary. Internally, it uses MARK(header_value) (Sets header_value_mark to the current pointer), then upon reaching the \r\n (in the next packet then, same buffer), but the \r\n will end up being before the header_value_mark pointer, thus ending up of never reading the part before the \r\n in the second packet. Test script: --------------- Use a valid header and ensure it's send in two different TCP packets to built-in server. Begin sending a header value in one packet and finish it in another. Then dump the header value. Expected result: ---------------- Header value should be complete. Actual result: -------------- The header value is being truncated at the exact packet boundary. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
Just wanted to add, I am experiencing this while trying to get Google's Identity Framework ("Gitkit") Quick Start for PHP working on my local computer for a school project. https://developers.google.com/identity/toolkit/web/quickstart/php I have a test site set up to accept Facebook or Google logins. My code is not significantly modified from theirs aside from removing the "password" login option from the config array. When logged in with my Facebook account, the Gitkit client-side JS library produces a 1015-character token that it stores in a cookie. Sporadically PHP truncates the token down to 310 characters or so, and as a result Google's OAuth2 library throws an exception (complaining the token does not have enough segments). Within a few refreshes it works again. When logged in with my Google account the token is only about 896 characters long. This rarely gets truncated and thus rarely throws the same exception.