-1

[header][1] [header][2]

i am trying to send a get request to etherpad hosted in a different domain. the OPTIONS preflight request goes through but the get request returns 403 status.

however when i install CORS for chrome extension the request goes through

when i install cors chrome extension the request goes through

here is my code: /* ........ export draft to html/pdf/word ........ */

            //get content for this template
            var url = Drafting.domain + Drafting.port + '/p/' + Drafting.padID + '/export/html?' + 'apikey=' + Drafting.apikey;

            $http.get(url).then(function(response, status){             
                if(typeof(callback)==='function' && callback)
                {
                    callback(response.data);
                }
            });         
        ```}


  [1]: https://i.stack.imgur.com/25dsj.png
  [2]: https://i.stack.imgur.com/ivHnn.png
mnmlst
  • 21
  • 3

1 Answers1

0

i just passed 'withCredentials:true' together with the url and then modified the importexport.js inside the etherpad files where 'AccessControlAllowOrigin' was set to '*' i replaced it with a specific domain and it worked.

mnmlst
  • 21
  • 3