Skip to content

[9.x] Breaking change with Http::withOptions(['connect_timeout' => 1]) #40465

Closed
@chu121su12

Description

@chu121su12
  • Laravel Version: 9.x-dev
  • PHP Version: 8.1.1
  • Guzzle Version: 7.4.1

Steps To Reproduce:

Run in tinker:

Http::withOptions([
  'timeout' => 1,
  'connect_timeout' => 1,
])->get('http://laravel.com')

Description:

This PR #40187 introduces breaking change to Http call above.

There's standalone timeout method to set timeout, but currently there's no way to set connect_timeout outside of withOptions. This is due to withOptions is doing array_merge_recursive causing existing options to be arrayed and when the options get to guzzle, it cannot handle array * int.

https://github.com/guzzle/guzzle/blob/c1fd316f0a0f3325ed1e7cdbe61030418b868f9f/src/Handler/CurlFactory.php#L416-L419

https://github.com/guzzle/guzzle/blob/c1fd316f0a0f3325ed1e7cdbe61030418b868f9f/src/Handler/CurlFactory.php#L430-L433

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