Skip to content

Handle onRequest only on REST Requests

Currently the onRequest Event is handled for ALL request (see source code).
This is an unnecessary workload as the handling is only required on requests towards the REST API.

A function like isRestRequestEvent in the quiqqer/rest-auth-token package could be used to check if it's a REST request.

Other packages like quiqqer/oauth (oauth-server#5) or quiqqer/rest-auth-token (quiqqer/rest-auth-token#2) would require an onRequest-event that's just fired for REST-requests.
Therefore the onRequest-event in quiqqer/rest may fire an onRestRequest-event if the current request is a REST request?
This way not every package would have to check itself if the current request is a REST request.

von Jan Wennrich bearbeitet