This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-c662fc04-2bc5-4e96-8e3e-892cf285a931 XWIKI-23252 Open

com.xpn.xwiki.web.Utils#isAjaxRequest is missing use cases

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-72daf61e-0e7f-4709-906e-2189e1fe50bd Thomas Mortagne created this issue on 27/May/25 16:06
 
Summary: com.xpn.xwiki.web.Utils#isAjaxRequest is missing use cases
Issue Type: cid:jira-generated-image-avatar-c662fc04-2bc5-4e96-8e3e-892cf285a931 Bug
Affects Versions: 17.4.0
Assignee: Unassigned
Components: Old Core
Created: 27/May/25 16:06
Priority: cid:jira-generated-image-static-major-017e851b-6ef9-43aa-8391-2a1b28f49a34 Major
Reporter: Thomas Mortagne
Description:

Currently, it relies (or more accurately XWikiAction#execute relies) on an explicit "?ajax=true" request parameter, but that's obviously not the definition of an ajax request, and it would be better to use a more reliable criterion.

For example, Michael Hamann suggested checking the presence of the request header XWiki-Form-Token, which is automatically added to every same-origin ajax requests since 14.10.8.