Giter VIP home page Giter VIP logo

Comments (5)

jonnyreeves avatar jonnyreeves commented on July 29, 2024 1

PR incoming.

I think this is the correct change to make, even if it's impactful to users when upgrading, as many users may not be aware of the default behaviour which circumvents the browser's security model. For those who were relying on this change, it should be fairly clear to them what has broken (ie: CORS) and a release note / changelog can call this out explicitly.

Also given that the project is still an alpha, early adopters should expect the occasional bump in the name of security, stability and performance ;)

from grpc-web.

petomalina avatar petomalina commented on July 29, 2024

I resolved the issue with the Origin Option like this

// Wrap grpc server to grpc-web server
wrappedServer := grpcweb.WrapServer(s, grpcweb.WithOriginFunc(func(origin string) bool {
	// disable all origins, this is all done by the proxy before these servers
	return false
}))

is there any better solution?

from grpc-web.

jonnyreeves avatar jonnyreeves commented on July 29, 2024

@MarcusLongmuir - IMHO the approach should be restrictive by default when it comes to security features such as CORS; would you welcome a patch that defaults to denying all CORS requests (from remote origins) and adds a custom Option helper: grpcweb.WithAllowAllOrigins()

from grpc-web.

MarcusLongmuir avatar MarcusLongmuir commented on July 29, 2024

@jonnyreeves: I agree. Would definitely welcome a patch, but this is likely to be a breaking change and it will need to be communicated.

At the very least (and only just palatable), we could change the function name to surface the change as a compilation error to anyone depending on master of this repo.

I think we need to fix up the release process as per #43 with this in mind.

Thoughts, @mwitkow?

from grpc-web.

jonny-improbable avatar jonny-improbable commented on July 29, 2024

Only took a year and a half, but #158 has now landed which closes this issue :)

from grpc-web.

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.