Problem/Motivation
In #3123832: [META] Fix @todo items referencing closed issues we've discovered there are a couple of identical @todos in \Drupal\Tests\rest\Unit\EventSubscriber\ResourceResponseSubscriberTest::providerTestResponseFormat.
This @todo is linked to an d.o. issue that is already closed: #2752325: Automatically provide HEAD support when a REST resource supports GET.
This is the @todo:
// @todo add 'HEAD' in https://www.drupal.org/node/2752325
Steps to reproduce
Proposed resolution
Re-enable the testGet() in this class since it now runs without errors.
Remaining tasks
Add 'HEAD'-method to \Drupal\Tests\rest\Unit\EventSubscriber\ResourceResponseSubscriberTest::providerTestResponseFormat, since support for that was added in #2752325: Automatically provide HEAD support when a REST resource supports GET.
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3374874
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3374874-add-head-method-to
changes, plain diff MR !4395
Comments
Comment #3
spokjeComment #4
smustgrave commentedSeems like a simple change that didn't break anything. Not sure much more to review so will mark for @Spokje
Comment #5
quietone commentedDid some digging and In #2752325: Automatically provide HEAD support when a REST resource supports GET this was added, which was removed in #2775479: Try to remove the "map HEAD to GET" logic in \Drupal\rest\RequestHandler::handle()
+ // @see \Symfony\Component\HttpFoundation\Response::prepare()
+ if ($method === 'head') {
+ $method = 'get';
+ }
The changes here seem correct to me. I will assign to myself to commit tomorrow (it is too late now).
Comment #7
quietone commentedOnce again, it has taken more than a day to get back to an issue. Wow 21 days, that is a new record.
It is now committed. Thanks!
Comment #10
quietone commented