Git Product home page Git Product logo

Comments (7)

sjqzhang avatar sjqzhang commented on May 21, 2024

可以提供支持,你有相关资料的链接或直接提供示例么?

from go-fastdfs.

jacobzeng avatar jacobzeng commented on May 21, 2024

意思就是当HTTP Method是OPTIONS的时候,Http Response Header里面要有
Access-Control-Allow-Origin: *,这时候不需要处理任何body,只需要设置Http Response Header就行

参考请求如下
Request URL: http://192.168.3.23:33310/upload
Request Method: OPTIONS

如果是Java Spring Web为参考的话,一般会设置跨域或者是写一个web filter处理所有OPTIONS请求,并直接设置Http Response Header并返回
registry.addMapping("/**").allowedOrigins("*").allowedMethods("GET", "POST", "DELETE");

参考资料https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

from go-fastdfs.

jacobzeng avatar jacobzeng commented on May 21, 2024

现在浏览器会提示错误如下:

Access to XMLHttpRequest at 'http://192.168.3.23:33310/upload' from origin 'http://localhost:4200' 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.

from go-fastdfs.

sjqzhang avatar sjqzhang commented on May 21, 2024

可以加微信,我编译一个包给你试一下,看看可不可以

from go-fastdfs.

jacobzeng avatar jacobzeng commented on May 21, 2024

好的,马上加你

from go-fastdfs.

sjqzhang avatar sjqzhang commented on May 21, 2024

下一版本支持。

from go-fastdfs.

kindomcat avatar kindomcat commented on May 21, 2024

请问现在的版本支持跨域了吗

from go-fastdfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.