Skip to content

Setting user agent for request does not seem to work #526

Closed
@grandeljay

Description

@grandeljay

I'm experiencing a lot of 403 responses and start playing around to see if the default user agent ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/20100101 Firefox/73.0") might be at fault here.

This is the code I am using:

$client = new \Embed\Http\CurlClient();
$client->setSettings(
    array(
        'user_agent' => 'pls work',
    )
);

$embed     = new \Embed\Embed(new \Embed\Http\Crawler($client));
$embedInfo = $embed->get($this->url);

As far as I can tell this is ignored and the default is used instead. Can you reproduce this? What am I doing wrong?

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