Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

[BUG] Stream needs to be rewinded before reading from it. #10

Description

@jeanpralo

Hi,

When reading from the vault it seems necessary to rewind the stream before reading from it, otherwise it is empty:

            $sf = new ServiceFactory($options, $this['monolog']);
            $kv = $sf->get('data');
            /**
             * @var $response \GuzzleHttp\Psr7\Response
             */
            $response = $kv->get('secret/config');
            $stream = $response->getBody();
            $stream->rewind();

Is there any particular reason why we would read from the Stream before doing a getBody ?

composer show | grep -E 'jippi|guzzle'
guzzlehttp/guzzle                  6.2.3   Guzzle is a PHP HTTP client library
guzzlehttp/promises                v1.3.1  Guzzle promises library
guzzlehttp/psr7                    1.4.1   PSR-7 message implementation that also provides common utility methods
jippi/vault-php-sdk                2.0.0   SDK to talk with vaultproject.io API

Thanks for all the work by the way @jippi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions