Skip to content

X-Magento-Tags header containing whitespaces causes exception #7640

Closed
@redelschaap

Description

@redelschaap

When the header X-Magento-Tags contains whitespaces, an Zend\Http\Header\Exception\InvalidArgumentException is being thrown when the full page cache is enabled. Block IDs can contain whitespaces due to reformatting in layout XML files, because of the 80 character line length limit.

Preconditions

Using Magento 2.1.2 with nginx and PHP7

Steps to reproduce

  1. Have layout files with block_id arguments that contain whitespaces (see image below)
  2. Enable full page cache
  3. Reload a page

Expected result

The page should be loaded correctly

Actual result

An error Zend\Http\Header\Exception\InvalidArgumentException: Invalid header value detected is being thrown.

Possible fix

Filter out whitespaces within argument tags when reading XML layout files.

Attachment

image

Metadata

Metadata

Assignees

Labels

Component: Framework/CacheIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions