Mrtaochen commented on PR #45:
URL: 
https://github.com/apache/skywalking-client-js/pull/45#issuecomment-1918725520

   > 现在,SDK将拦截所有`XHR`请求并添加`ws8`请求标头。在跨域时,服务器需要添加标头。
   > 
   > ```
   > Access-Control-Allow-Headers: ws8
   > ```
   > 
   > https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#preflighted_requests
   > 
   > 在某些情况下,我们可能会请求第三方服务。如果第三方服务器不添加top header,就会出现跨域问题。
   > 
   > @wu-sheng
   > 
   > 添加`originAllowlist`选项,仅跟踪此列表中的请求来源。
   > 
   > ```js
   > import ClientMonitor from 'skywalking-client-js';
   > 
   > ClientMonitor.setPerformance({
   >   collector: 'http://127.0.0.1:8080',
   >   service: 'browser-app',
   >   serviceVersion: '1.0.0',
   >   pagePath: location.href,
   >   useFmp: true,
   >   noTraceOrigins: ['http://example1.com', /\.example2\.com$/]
   > });
   > ```
   
   想请问一个问题,是否允许自定义请求头名呢?如Access-Control-Allow-Headers: xxx-sw8


-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to