lula / ngx-soap

Simple SOAP client for Angular
MIT License
66 stars 61 forks source link

CORS problem #37

Closed AnaflaviaDiaz closed 5 years ago

AnaflaviaDiaz commented 5 years ago

image How can I fix this problem with CORS? image image

lula commented 5 years ago

Hello @AnaflaviaDiaz! if you're in development then you can use a proxy to test withng serve --proxy-config proxy.conf.json.

RezaRahmati commented 4 years ago

@lula angular proxy only works when you do ng serve, if you build by ng build you can't set proxy, and CORS issue happens

lula commented 4 years ago

Yes, that's normal. CORS issues have nothing to do with this lib. You have to have your client whitelisted in the server, or use some reverse proxy.

RezaRahmati commented 4 years ago

@lula thanks for fast response, the server white listed the client and urls and methods, the issue is I don't see any preflight request (OPTION) being send, which usually should be done automatically by browser

lula commented 4 years ago

@RezaRahmati you're welcome :). I don't think the preflight request is automatically done by the browser, I believe you should do it yourself as you need to add headers to the (second) request.

RezaRahmati commented 4 years ago

@lula OK, anyway preflight request are sent by browser see https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request paragraph 3