diff --git a/.travis.yml b/.travis.yml index 07f0c287..5fde2d46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,7 @@ language: php php: - '7.1' before_install: -- openssl aes-256-cbc -K $encrypted_5699a01b7a5f_key -iv $encrypted_5699a01b7a5f_iv - -in madeline_rsa.enc -out madeline_rsa -d - echo "phar.readonly = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini -- chmod 600 madeline_rsa script: - tests/makephar.sh diff --git a/madeline_rsa.enc b/madeline_rsa.enc deleted file mode 100644 index f9295f65..00000000 Binary files a/madeline_rsa.enc and /dev/null differ diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index dedea6f6..24a1ab92 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -341,6 +341,7 @@ class Connection case 'https': $headers = []; $close = false; + $length = 0; while (true) { $current_header = ''; while (($curchar = $this->read(1)) !== "\n") { @@ -362,8 +363,9 @@ class Connection $headers[] = $current_header; } $read = $this->read($length); - if ($headers[0] !== 'HTTP/1.1 200 OK') { - throw new Exception($headers[0]); + $headers[0] = explode(" ", $headers[0], 3); + if ($headers[0][1] !== '200') { + throw new Exception($headers[0][2]); } if ($close) { $this->close_and_reopen(); diff --git a/tests/makephar.sh b/tests/makephar.sh index 1836a2e0..24195a43 100755 --- a/tests/makephar.sh +++ b/tests/makephar.sh @@ -30,11 +30,13 @@ echo '{ composer update cd .. -$php7to5 convert --copy-all phar7 phar5 +$php7to5 convert --copy-all phar7 phar5 >/dev/null php makephar.php phar5 madeline.phar $TRAVIS_COMMIT eval "$(ssh-agent -s)" +echo -e "$private_key" > madeline_rsa +chmod 600 madeline_rsa ssh-add madeline_rsa git clone git@github.com:danog/MadelineProtoPhar cd MadelineProtoPhar @@ -53,6 +55,6 @@ for chat_id in $destinations;do $TRAVIS_COMMIT_MESSAGE" -F parse_mode="HTML" -F chat_id=$chat_id | JSON.sh/JSON.sh -s | egrep '\["result","message_id"\]' | cut -f 2 | cut -d '"' -f 2) - echo "$TRAVIS_COMMIT_MESSAGE" | grep -q release_phar && curl -s https://api.telegram.org/bot$token/sendDocument -F caption="md5: $(md5sum madeline.phar | sed 's/\s.*//g') + #echo "$TRAVIS_COMMIT_MESSAGE" | grep -q release_phar && curl -s https://api.telegram.org/bot$token/sendDocument -F caption="md5: $(md5sum madeline.phar | sed 's/\s.*//g') commit: $TRAVIS_COMMIT" -F chat_id=$chat_id -F document=@madeline.phar -F reply_to_message_id=$ID done