tianyk commented on pull request #45:
URL: 
https://github.com/apache/skywalking-client-js/pull/45#issuecomment-794993768


   > > > What's more, in the case of unclear services, such as cross domain, 
how can we solve this problem if we don't know the service address?
   > > 
   > > 
   > > When using JS-SDK, we don't directly have to make our own HTTP requests.
   > > @wu-sheng @Fine0830
   > > ```
   > > <script 
src="https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js";></script>
   > > <script>
   > >  // Comment out and try it here
   > >  ClientMonitor.register({
   > >          collector: 'http://127.0.0.1:8080',
   > >          service: 'test-ui',
   > >          pagePath: '/current/page/name',
   > >          serviceVersion: 'v1.0.0'
   > >  });
   > > </script>
   > > 
   > > <script>
   > >        // js-sdk
   > >       (function() {
   > >                fetch('http://kekek.cc/static/bear.bin');
   > >       })();
   > > </script>
   > > ```
   > 
   > When I use like this, here is an error with Cross domain.
   > 
![image](https://user-images.githubusercontent.com/20871783/110589183-02236280-81b1-11eb-98b1-4f1dedd36ff0.png)
   
   You turn off trace, the error is gone.
   
   Because in this example, the server only add `Access-Control-Allow-Origin` 
without handling `Access-Control-Request-Headers`
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to