Decision Management (ODM,ADS)

 View Only
Expand all | Collapse all

CORS questions when running Eclipse ODM locally

  • 1.  CORS questions when running Eclipse ODM locally

    Posted Sun December 17, 2023 11:26 PM

    Hi does anyone tried to intercept incoming API request and add in CORS header?
    We like to have below header in the response.
    Because we are doing some internal testing which require browser to API call ODM directly.

    Access-Control-Allow-Origin: *



    ------------------------------
    Kian Seng Goh
    ------------------------------


  • 2.  RE: CORS questions when running Eclipse ODM locally

    Posted Mon December 18, 2023 04:56 AM

    If you are running internally using WAS Liberty then you can add the following to the Liberty server.xml to accept the CORS calls.
        <cors domain="/DecisionService"
              allowedOrigins="http://localhost:9090"
              allowedMethods="GET, DELETE, POST"
              allowedHeaders="accept, Request, content-type"
              exposeHeaders="Request"
              allowCredentials="true"
              maxAge="3600" />

    Alternatively if you launch the browser app using the Rule Designer's Internal Browser (Eclipse Preferences > General > Web Browser) then I find this sometimes avoids the CORS issue.



    ------------------------------
    Andy Macdonald
    ------------------------------