Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
redelschaap opened this issue Dec 1, 2016 · 7 comments
Closed

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

redelschaap opened this issue Dec 1, 2016 · 7 comments
Assignees
Labels
bug report Component: Framework/Cache Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@redelschaap
Copy link
Contributor

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

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Dec 2, 2016

We had a lot issues like this in M1, that were caused by automatic xml formatting in PhpStorm. Would be great to add trim values, it will fix this issue.

@redelschaap
Copy link
Contributor Author

It would. I couldn't find the right place to add trim functions so quickly, otherwise I would have made a pull request.

@magento-engcom-team magento-engcom-team added 2.1.x bug report Component: Framework/Cache Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 9, 2017
@magento-engcom-team
Copy link
Contributor

@redelschaap, thank you for your report.
We've created internal ticket(s) MAGETWO-81249 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 11, 2017
@nmalevanec nmalevanec self-assigned this Oct 25, 2017
@okorshenko
Copy link
Contributor

@redelschaap the issue has been fixed and delivered to 2.2-develop branch. Will be available with 2.2.2 release

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82887

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82983

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Framework/Cache Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants