You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by GitBox <gi...@apache.org> on 2025/05/05 13:09:09 UTC
[GH] (ofbiz-framework/OFBIZ-13231): Workflow run "CodeQL" failed!
The GitHub Actions job "CodeQL" on ofbiz-framework.git/OFBIZ-13231 has failed.
Run started by GitHub user nmalin (triggered by nmalin).
Head commit for run:
53bbd267d6f28125f66e36a39b4d3d21412dcc18 / Nicolas Malin <ni...@nereide.fr>
Fixed: Ajax request fail on restful page (OFBIZ-13231)
A problem was detected with some ajax call did by js script that failed with error 405 like :
https://demo-next.ofbiz.apache.org/webtools/control/entity/find/SetTimeZoneFromBrowser
Reason :
SetTimeZoneFromBrowser is a request define in common-controller.xml, so available on all component. In js the call is realized by :
$.ajax({
url: "SetTimeZoneFromBrowser",
type: "POST",
async: false,...
So the navigator use the relative url to execute the call. In general case we have a page like https://demo-next.ofbiz.apache.org/$component/control/$request so js script realized their call with https://demo-next.ofbiz.apache.org/$component/control/$request-js. Like each request-js are present on common-controller.xml all component that include it can response.
With rest url, the uri pattern is more complex and the script js that generate a relative call like we have upper : _https://demo-next.ofbiz.apache.org/webtools/control/entity/find/SetTimeZoneFromBrowse_.
The ControlServlet behind failed to retrieve the correct request and generate a http error 405
To fix :
we remove all relative js call and create a dedicated webapp for that.
[code]
$.ajax({
url: "/common-js/control/SetTimeZoneFromBrowser",
type: "POST",
async: false,...
[code]
To pass through the authentification (we implement a new webapp), we store a jwt token with the current userLogin after the authentification that will use by common-ext to confirm authentification. This cookie is available during all the session time
Report URL: https://github.com/apache/ofbiz-framework/actions/runs/14836976372
With regards,
GitHub Actions via GitBox