Skip to content

Vimeo referer header #567

Open
Open

Description

@royvangeel

Hi, I have two questions regarding oEmbed:

  • When retrieving the full oEmbed data for a Vimeo video with domain-level privacy, a Referer header is required. I couldn’t find a way to add this header to the request. What’s the recommended approach for handling this?
  • What is the safest way to verify that oEmbed data has been successfully fetched? The getOEmbed method always returns an OEmbed instance, so it’s unclear how to detect failures.

Thanks in advance!

Activity

  1. royvangeel commented on Jan 12, 2026

    @royvangeel
    Author

    Anyone?

  2. oscarotero commented on Jan 12, 2026

    @oscarotero
    Collaborator

    You can configure the crawler to set default headers.

    $embed->getCrawler()->addDefaultHeaders([
      'Referer' => 'foo',
    ]);
  3. Vitorinox commented on Nov 12, 2026

    @Vitorinox
    Collaborator

    Thanks for the question. PR #592 adds a README section, "Checking the oEmbed result", explaining that a failed or empty oEmbed response can be detected with $info->getOEmbed()->all() === []. It also documents the Vimeo case: for videos with domain-level privacy, send an allowed Referer with addDefaultHeaders() and check domain_status_code in the oEmbed data. The PR also fixes a bug where that Referer was lost after a redirect.

    It is planned for 4.6.3. To try it before the release:

    composer require embed/embed:dev-fix/vimeo-4.6.3
    

    We will leave the PR open for a few days in case you have comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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