• 请不要在回答技术问题时复制粘贴 AI 生成的内容
pinews
V2EX  ›  程序员

遇到一个奇怪的问题,在本地测试某云对象存储的时候,之前跨域好好的,后来几次都说不让用,后来发现是开着某代理软件的锅。

  •  
  •   pinews · Jul 15, 2019 · 1593 views
    This topic created in 2501 days ago, the information mentioned may be changed or developed.
    代理不是对本地不起作用么,再说和 cros 有什么关系啊,纯粹是好奇一问。

    Access to XMLHttpRequest at 'http://xx.xxxxxx.com/' from origin 'http://localhost' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    2 replies    2019-07-15 15:42:29 +08:00
    jifengg
        1
    jifengg  
       Jul 15, 2019
    1.代理也可以对本地起作用的,看具体配置。
    2.就算对 localhost 不起作用,但是对你的对象存储的域名起作用。
    3.跨域问题,看看是不是开了代理之后,“ Access-Control-Allow-Origin ”这个头没有返回回来。
    pinews
        2
    pinews  
    OP
       Jul 15, 2019
    @jifengg 有道理
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5160 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 08:01 · PVG 16:01 · LAX 01:01 · JFK 04:01
    ♥ Do have faith in what you're doing.