Description
This is a patch to add Ajax support to the kernel, the point of this is to avoid storing LastAccessesURI and LastAccessedModifyingURI sessions when the request is identified as a xhr / ajax type.
This is done by adding 4 new functions to eZHTTPTool:
- getXhrType()
identifies the request based on de facto(used in all major Ajax/JavaScript libraries) http header ('X-Requested-With'), but also looks for this parameter in get and post variables.
If it is not found or not equal to 'xmlhttprequest', it returns false.
supported types: 'xhr', 'post', 'get' or false
- setXhrType()
Lets you explicit set the type, useful if you want to override this from extension
- getXhrResponseType()
Looks up the http 'Accept' header to get the preferred response type, not currently used in the kernel but will be useful for extensions. In the future it can be used to let the kernel be context aware so debug and error codes are in correct format.
Also supports setting the accept value in post or get parameter as 'http_accept'.
supported types: text, json, xml and xhtml
- setXhrResponseType()
Lets you explicit set the preferred response type.
Attachments
Issue Links
- relates to
-
EZP-16250 do not set lastaccessuri when a page is requested by error as source of an image - bug on redirect after edit
- Closed