Allow X-Requested-With with value XMLHttpRequest over XmlHttpRequest#109
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #109 +/- ##
=======================================
Coverage 98.64% 98.64%
=======================================
Files 18 18
Lines 296 296
=======================================
Hits 292 292
Misses 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR corrects the value of the X-Requested-With header from XmlHttpRequest to XMLHttpRequest to align with the standard convention used by JavaScript libraries like jQuery. The change ensures proper detection of AJAX requests.
- Updates the header value check in the middleware from
XmlHttpRequesttoXMLHttpRequest - Updates corresponding test cases to use the corrected header value
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Middleware/Mezzio.php | Updates the X-Requested-With header value check from 'XmlHttpRequest' to 'XMLHttpRequest' |
| spec/Middleware/MezzioSpec.php | Updates four test cases to use the corrected 'XMLHttpRequest' header value |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Tested with jQuery, which seems using |
Reference: