Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!5232
Issue
#3398849
: DELETE request on REST resource leads to null format given
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3398849
: DELETE request on REST resource leads to null format given
issue/drupal-3398849:3398849-delete-null-format-given
into
9.5.x
Overview
0
Commits
2
Pipelines
0
Changes
1
Open
apersky
requested to merge
issue/drupal-3398849:3398849-delete-null-format-given
into
9.5.x
1 year ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
(cherry picked from commit
2d38f1ec
)
Closes
#3398849
0
0
Merge request reports
Compare
9.5.x
version 2
f7deedb6
1 year ago
version 1
f7deedb6
1 year ago
9.5.x (HEAD)
and
latest version
latest version
28fba577
2 commits,
1 year ago
version 2
f7deedb6
1 commit,
1 year ago
version 1
f7deedb6
1446 commits,
1 year ago
1 file
+
11
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/modules/rest/src/EventSubscriber/ResourceResponseSubscriber.php
+
11
−
0
Options
@@ -102,6 +102,17 @@ public function getResponseFormat(RouteMatchInterface $route_match, Request $req
$requested_format
=
$request
->
getRequestFormat
();
$content_type_format
=
$request
->
getContentType
();
// Workaround for if there is no formats for a DELETE call:
// make the response formats match the format of the request
if
(
$request
->
getMethod
()
===
'DELETE'
)
{
if
(
empty
(
$acceptable_request_formats
))
{
$acceptable_request_formats
=
[
$requested_format
];
}
if
(
empty
(
$acceptable_formats
))
{
$acceptable_formats
=
[
$requested_format
];
}
}
// If an acceptable response format is requested, then use that. Otherwise,
// including and particularly when the client forgot to specify a response
// format, then use heuristics to select the format that is most likely
Loading