craftcms / element-api

Create a JSON API/Feed for your elements in Craft.
MIT License
498 stars 56 forks source link

Fix caching of endpoints #91

Closed menberg closed 4 years ago

menberg commented 5 years ago

When manually executing Element API endpoint queries via Craft::$app->request->setPathInfo($endpoint); Craft::$app->runAction('element-api', ['pattern'=>$endpoint]), Element API caching is not working correctly as getPathInfo() does not return the updated path. Fixed by changing to getPathInfo(true).

brandonkelly commented 4 years ago

This would revert to Yii-based path resolution rather than Craft’s, which operates very differently. Would likely have unintended consequences.