You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/04/25 09:07:12 UTC

[GitHub] [apisix] xujiesh0510 opened a new issue #4126: cors 不起作用

xujiesh0510 opened a new issue #4126:
URL: https://github.com/apache/apisix/issues/4126


   ### Issue description
   
   ### Environment
   docker镜像版本
   * apisix version  : 2.4
   * apisix-dashboard version, if have: 2.5
   
   路由配了个跨域:
   
   "cors": {
         "allow_credential": true,
         "allow_headers": "**",
         "allow_methods": "**",
         "allow_origins": "**",
         "allow_origins_by_regex": [
           "*.platform.flexem.net",
           "localhost"
         ],
         "disable": false,
         "expose_headers": "aaa",
         "max_age": 5
       },
   
   本地用localhost 跨这个路由对应的 host: 
   
   报 
   
   Access to XMLHttpRequest at 'http://im-dev.platform.flexem.net/hubs/communication/negotiate?negotiateVersion=1' from origin 'http://localhost' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
   
   但是 http://im-abc.platform.flexem.net 去跨 这个路由对应的host正常
    
   


-- 
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:
users@infra.apache.org



[GitHub] [apisix] xujiesh0510 commented on issue #4126: cors 不起作用

Posted by GitBox <gi...@apache.org>.
xujiesh0510 commented on issue #4126:
URL: https://github.com/apache/apisix/issues/4126#issuecomment-826290547


   抓包后发现 服务器返回  301 ,业务的问题。改成 跨 https 后就没问题了 


-- 
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:
users@infra.apache.org



[GitHub] [apisix] xujiesh0510 commented on issue #4126: cors 不起作用

Posted by GitBox <gi...@apache.org>.
xujiesh0510 commented on issue #4126:
URL: https://github.com/apache/apisix/issues/4126#issuecomment-826289520


   可能是我的问题,抓包 返回了 301 重定向
   
   ![image](https://user-images.githubusercontent.com/10271679/115988029-557b3400-a5ea-11eb-867f-ff8d8dd1531b.png)
   


-- 
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:
users@infra.apache.org



[GitHub] [apisix] xujiesh0510 closed issue #4126: cors 不起作用

Posted by GitBox <gi...@apache.org>.
xujiesh0510 closed issue #4126:
URL: https://github.com/apache/apisix/issues/4126


   


-- 
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:
users@infra.apache.org



[GitHub] [apisix] xujiesh0510 closed issue #4126: cors 不起作用

Posted by GitBox <gi...@apache.org>.
xujiesh0510 closed issue #4126:
URL: https://github.com/apache/apisix/issues/4126


   


-- 
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:
users@infra.apache.org



[GitHub] [apisix] xujiesh0510 commented on issue #4126: cors 不起作用

Posted by GitBox <gi...@apache.org>.
xujiesh0510 commented on issue #4126:
URL: https://github.com/apache/apisix/issues/4126#issuecomment-826289520






-- 
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:
users@infra.apache.org