media.oembed_iframe route request checks

Created on 2 September 2024, about 2 months ago
Updated 3 September 2024, about 1 month ago

Problem/Motivation

When bots are visiting /media/oembed it gives an error in error log

Symfony\Component\HttpKernel\Exception\BadRequestHttpException: This resource is not available in Drupal\media\Controller\OEmbedIframeController->render() (line 144 of /code/web/core/modules/media/src/Controller/OEmbedIframeController.php).

Steps to reproduce

visit /media/oembed without get params and not using get

Proposed resolution

Add to media.routing.yml routing media.oembed_iframe

- add methods: [GET]
- to requirements: all needed params ( required url and optional - width, height, hash)

It will prevent log errors and make them less breakable as requests will be already checked.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
MediaΒ  β†’

Last updated about 3 hours ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024