FinishResponseSubscriber: Need warning/error when headers exceed 16k

Created on 18 January 2017, over 8 years ago
Updated 25 January 2023, over 2 years ago

Drupal 8 can send HTTP headers up-to 16kb.
https://www.drupal.org/docs/8/api/cache-api/cache-tags β†’

Downstream systems are being updated to support this. If Drupal sends a request that exceeds 16k the downstream systems will fail with inconclusive errors. For example Varnish will return "HTTP/1.1 502 Bad Gateway." Very few people will be able to debug this sort of situation. We recently encountered a situation with a 50k header!

If a request has too many cache-tags associated with it the header size could exceed 16kb. When this occurs Drupal should provide feedback. Some possible approaches:

  1. Throw a 50x error.
  2. Log an error but allow the request through.

My gut is that this should be treated like an out of memory exception at PHP and be made obvious? Thoughts?

πŸ› Bug report
Status

Needs review

Version

10.1 ✨

Component
Request processingΒ  β†’

Last updated 5 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States adam.weingarten

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024