- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
This could use steps to reproduce. I don't notice this on 404s pages or regular pages.
- 🇺🇸United States smustgrave
#36 applied to 10.1 fine.
Please include an interdiff with files also. Hiding #40 - 🇮🇳India narendraR Jaipur, India
Re #39, I was able to reproduce this issue in 11.x by adding
--- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php @@ -118,6 +118,9 @@ public function onRespond(ResponseEvent $event) { // Set the Content-language header. $response->headers->set('Content-language', $this->languageManager->getCurrentLanguage()->getId()); + $response->headers->set('foo', 'bar', FALSE); + $response->headers->set('foo', 'bar', FALSE);
in
core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
.
This will show 2 entry in header response in network tab.
But I am not sure if this is the correct way to reproduce this issue. Once confirmed IS can be updated. - 🇮🇳India narendraR Jaipur, India
I will make a PR of the provided patch so that review can be done easily.
- Merge request !4356Issue #2861552: Duplicate HTTP headers should be removed → (Open) created by narendraR
- last update
over 1 year ago 29,799 pass, 1 fail - last update
over 1 year ago 29,808 pass - Status changed to Needs review
over 1 year ago 9:32am 11 July 2023 - Status changed to RTBC
over 1 year ago 3:11pm 11 July 2023 - 🇺🇸United States smustgrave
Seems like a simple enough change.
Test does fail without the fix
Duplicate HTTP link headers were removed. Failed asserting that true is false.
- last update
over 1 year ago 29,812 pass - last update
over 1 year ago 29,816 pass - last update
over 1 year ago 29,816 pass - last update
over 1 year ago 29,823 pass - Status changed to Needs work
over 1 year ago 12:49pm 19 July 2023 - last update
over 1 year ago 29,823 pass - Status changed to Needs review
over 1 year ago 6:06pm 19 July 2023 - Status changed to RTBC
over 1 year ago 6:33pm 19 July 2023 - 🇺🇸United States smustgrave
Assert was added per the thread.
Going to remark it.
- last update
over 1 year ago 29,843 pass - last update
over 1 year ago 29,867 pass, 2 fail - last update
over 1 year ago 29,874 pass, 1 fail - last update
over 1 year ago 29,886 pass - last update
over 1 year ago 29,909 pass - last update
over 1 year ago 29,912 pass - last update
over 1 year ago 29,947 pass - last update
over 1 year ago 29,954 pass 20:38 16:49 Running- last update
over 1 year ago 29,959 pass - last update
over 1 year ago 29,959 pass - last update
over 1 year ago 29,959 pass - last update
over 1 year ago 29,960 pass - 🇳🇿New Zealand quietone
I am doing triage on the core RTBC queue → .
I read the issue summary which has a proposed resolution, so reviewers know what they are looking for. I then read the comments. I found everything answered.
I applied the patch and confirmed it fails without the fix. I did not review the MR.
Leaving at RTBC
- Status changed to Needs review
over 1 year ago 9:54am 16 August 2023 - 🇬🇧United Kingdom longwave UK
This Stack Overflow answer implies that duplicate headers are allowed, at least in some cases: https://stackoverflow.com/questions/4371328/are-duplicate-http-response-...
The example given is that
Cache-Control: no-cache, no-store
is equivalent to
Cache-Control: no-cache Cache-Control: no-store
So are we doing the right thing here?
Also this code seems to deduplicate by value, but without taking the key into account? I haven't tested this but it appears that if you generate two headers with the same value but different keys, they might be treated as duplicates?
- Status changed to Needs work
over 1 year ago 3:06pm 16 August 2023 - 🇺🇸United States smustgrave
#52 did not test but think that would be a good test to include.
- last update
over 1 year ago 29,972 pass - 🇮🇳India narendraR Jaipur, India
@longwave
I haven't tested this but it appears that if you generate two headers with the same value but different keys, they might be treated as duplicates?
Correct, But I am not sure how to reproduce above scenario. Can you please provide some code reference, so that I can try to reproduce and fix it?
If the issue is only with Link headers, perhaps we should only be deduplicating these.
Done
@smustgrave,
#52 did not test but think that would be a good test to include.
Test is already added for duplicate links. Please elaborate what needs to be done here. Thanks.
- Status changed to Needs review
over 1 year ago 3:19pm 17 August 2023 - 🇺🇸United States smustgrave
two headers with the same value but different keys,
- Status changed to RTBC
over 1 year ago 6:34pm 25 August 2023 20:38 19:26 Running- last update
over 1 year ago 30,049 pass, 2 fail - last update
over 1 year ago 30,064 pass - last update
over 1 year ago 30,131 pass - Status changed to Needs work
over 1 year ago 11:27am 2 September 2023 - 🇳🇿New Zealand quietone
Setting to needs work for unresolved comments on the MR,
- 🇳🇿New Zealand quietone
Because of @longwave's comment I have added a link to the latest RFC to the Issue Summary.
- last update
over 1 year ago 30,136 pass - last update
over 1 year ago 30,124 pass, 2 fail - last update
over 1 year ago 30,136 pass - Status changed to Needs review
over 1 year ago 6:51am 4 September 2023 - Status changed to RTBC
over 1 year ago 4:57pm 4 September 2023 - last update
over 1 year ago 30,137 pass - last update
over 1 year ago 30,147 pass - last update
over 1 year ago 30,145 pass, 2 fail - last update
over 1 year ago 30,149 pass - last update
over 1 year ago 30,146 pass, 2 fail - last update
over 1 year ago 30,162 pass - last update
over 1 year ago 30,165 pass - last update
over 1 year ago 30,169 pass - last update
over 1 year ago 30,169 pass - last update
over 1 year ago 30,206 pass - 🇭🇺Hungary Gábor Hojtsy Hungary
I think the MR looks good, only Link headers are considered which was the source of the bug. There is good test coverage. Duplicate link header values are removed. I agree this is good to go.
- last update
over 1 year ago 30,364 pass - last update
over 1 year ago 30,366 pass - last update
over 1 year ago 30,361 pass - last update
over 1 year ago 30,363 pass - last update
over 1 year ago 30,380 pass - last update
over 1 year ago 30,378 pass - last update
over 1 year ago 30,383 pass - last update
over 1 year ago 30,393 pass - last update
over 1 year ago 30,398 pass 35:35 34:27 Running- last update
about 1 year ago 30,414 pass - last update
about 1 year ago 30,418 pass - last update
about 1 year ago 30,426 pass - last update
about 1 year ago 30,427 pass - last update
about 1 year ago 30,437 pass - last update
about 1 year ago 30,439 pass - last update
about 1 year ago 30,465 pass - last update
about 1 year ago 30,482 pass - last update
about 1 year ago 30,484 pass - last update
about 1 year ago 30,487 pass - last update
about 1 year ago 30,487 pass - last update
about 1 year ago 30,511 pass - last update
about 1 year ago 30,517 pass - last update
about 1 year ago 30,519 pass, 1 fail - last update
about 1 year ago 30,531 pass - last update
about 1 year ago 30,561 pass - last update
about 1 year ago 30,603 pass - last update
about 1 year ago 30,605 pass - last update
about 1 year ago 30,606 pass - last update
about 1 year ago 30,669 pass - last update
about 1 year ago 30,675 pass, 2 fail - last update
about 1 year ago 30,685 pass - last update
about 1 year ago 30,687 pass 20:37 17:10 Running- last update
about 1 year ago 30,689 pass - last update
about 1 year ago 30,697 pass - last update
about 1 year ago 30,699 pass - Status changed to Needs work
about 1 year ago 12:03am 11 December 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
I've added some comments on the MR that needs addressing.
- Status changed to Needs review
about 1 year ago 10:51am 12 December 2023 - Status changed to RTBC
about 1 year ago 2:58pm 12 December 2023 - 🇺🇸United States smustgrave
There was 1 failure: 1) Drupal\KernelTests\Core\Render\RenderTest::testDuplicateLinkHeaders Failed asserting that actual size 2 matches expected size 1. /builds/issue/drupal-2861552/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121 /builds/issue/drupal-2861552/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55 /builds/issue/drupal-2861552/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php:92 /builds/issue/drupal-2861552/vendor/phpunit/phpunit/src/Framework/TestResult.php:728 FAILURES! Tests: 4, Assertions: 4, Failures: 1.
Re ran test-only feature to make sure test coverage was still good with the latest changes.
See all threads have been addressed, believe this is still good.
- last update
about 1 year ago 30,713 pass - Status changed to Needs work
about 1 year ago 10:04am 13 December 2023 - 🇸🇰Slovakia poker10
I have reviewed the MR and left one comment which is probably still not resolved from previous threads.
And also one additional minor comment.
Otherwise I think this looks good!
- Status changed to Needs review
about 1 year ago 5:19pm 13 December 2023 - Status changed to RTBC
about 1 year ago 5:43pm 13 December 2023 - 🇸🇰Slovakia poker10
My points seems to be resolved, so moving back to RTBC. Thanks.
- last update
about 1 year ago 30,727 pass - last update
about 1 year ago 30,767 pass - last update
about 1 year ago 25,905 pass, 1,800 fail - last update
about 1 year ago 25,910 pass, 1,833 fail - last update
about 1 year ago 25,936 pass, 1,808 fail - last update
about 1 year ago 25,949 pass, 1,798 fail - last update
about 1 year ago 25,971 pass, 1,793 fail - last update
about 1 year ago 25,916 pass, 1,824 fail - Status changed to Needs review
about 1 year ago 11:29pm 29 December 2023 - 🇳🇿New Zealand quietone
Reviewing this again and I now see that the current solution is different from the one in #18 🐛 Duplicate HTTP headers should be removed RTBC . That solution changes \Drupal\Core\Render\HtmlResponseAttachmentsProcessor::processHtmlHeadLink to prevent the additional of duplicates in the first place. I tested this version with the version of the test in the latest MR and it does work. The current solution started in #30 🐛 Duplicate HTTP headers should be removed RTBC and removes duplicate headers. Unfortunately, there has not been a discussion of which approach is preferred.
So, I am setting this back to Needs Review to decide which is the preferred solution. Sorry that I missed this point in my previous visits to this issue.
- Status changed to Needs work
about 1 year ago 12:31am 2 January 2024 - 🇺🇸United States smustgrave
Tagging for issue summary to be updated to clear things up.
- 🇮🇳India narendraR Jaipur, India
I am not sure if this still requires IS update as Remaining tasks already mention about decision to be made related to the approach.
- Status changed to Needs review
about 1 year ago 7:32am 4 January 2024 - Status changed to Needs work
about 1 year ago 2:17pm 10 January 2024 - 🇺🇸United States smustgrave
Sorry meant can it be clearly noted in the issue summary the pros/cons of each approach.
Can go in the proposed solution as "a)" and "b)"
tagging for submaintainer for make the call though. Unless you know someone else that can and we can ping them.