Skip to content

Missing root password into rebuild response #17

Closed
@mateusz324

Description

@mateusz324

In a: https://github.com/LKDevelopment/hetzner-cloud-php-sdk/blob/master/src/Models/Servers/Server.php#L354

you should change this code:

           return APIResponse::create([
                'action' => Action::parse(json_decode((string)$response->getBody())->action)
            ], $response->getHeaders());

on this:

            $payload = json_decode((string)$response->getBody());
            return APIResponse::create(array_merge([
                'action' => Action::parse($payload->action),
            ], (property_exists($payload, 'root_password')) ? ['root_password' => $payload->root_password] : []
            ), $response->getHeaders());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions