Coder Social home page Coder Social logo

Enable CORS Support about com_api HOT 5 CLOSED

techjoomla avatar techjoomla commented on August 22, 2024
Enable CORS Support

from com_api.

Comments (5)

coolbung avatar coolbung commented on August 22, 2024 1

Good find Sushan !

Let's use all the above comments to have a really solid CORS implementation

from com_api.

coolbung avatar coolbung commented on August 22, 2024

Also set the Access-Control-Allow-Headers value should be Authorization, Access-Control-Allow-Origin, Access-Control-Allow-Methods, X-Authorization, X-Compatibility-Mode, Content-Type, Accept

from com_api.

coolbung avatar coolbung commented on August 22, 2024

@thite-amol in the config section create a new tab CORS and move the existing 2 options there. Also add the above as a third option with comma separated list of headers in a textarea.

from com_api.

sushan05 avatar sushan05 commented on August 22, 2024

@thite-amol - Faced an issue while calling the API if multiple domains (separated by comma) are provided in "Allow Cross Origin Requests" field. The error message is as follows-

XMLHttpRequest cannot load http://staging.xyz.com/index.php?option=com_api&app=external&resource=homepage&format=raw.
The 'Access-Control-Allow-Origin' header contains multiple values 'http://client-xyz.host/, http://yahoo.com, http://google.com', but only one is allowed. Origin 'http://client-xyz.host' is therefore not allowed access.

After some research, found this link that explains how it works - https://stackoverflow.com/questions/1653308/access-control-allow-origin-multiple-origin-domains

from com_api.

thite-amol avatar thite-amol commented on August 22, 2024

This feature is implemented in the latest package so closing it from here.

from com_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.