-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update latest pekko-http to bring in cors #106
Update latest pekko-http to bring in cors #106
Conversation
4b4e349
to
0563fb1
Compare
|
||
@ApiMayChange | ||
object WebHandler { | ||
|
||
/** Default CORS settings to use for grpc-web */ | ||
val defaultCorsSettings: CorsSettings = CorsSettings.defaultSettings | ||
val defaultCorsSettings: CorsSettings = CorsSettings(ConfigFactory.load()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lomigmegard So I am trying to get rid of the now deprecated CorsSettings.defaultSettings
, do you think this is fine for now given that we don't want to change the API for the first release? Passing either Config
or ActorSystem
as a parameter to defaultCorsSettings
while changing it to a def
would require more significant changes.
I suspect that this API can use improvements in future versions (and it is marked as @ApiMayChange
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this refers to actorsystem's config? or will have another config instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this refer to the ActorSystem
's config will require more significant code changes, i.e. defaultCorsSettings
will have to change to a def
and due to the usage of implicit default paramters in https://github.com/mdedetrich/incubator-pekko-grpc/blob/0563fb1672c6ca831423d02925687c8635fd0d03/runtime/src/main/scala/org/apache/pekko/grpc/scaladsl/WebHandler.scala#L63 it will also require rewiring of code.
Or as you said it will need us to create a new actor system instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to retain good compatibility with akka-http-cors - so big refactors should wait till a later pekko-http release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also to note, CorsSettings(ConfigFactory.load())
is semantically the same as the original CorsSettings.defaultSettings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdedetrich that should be fine yes, given the constraints of not changing the interface of this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, merging then!
@@ -32,8 +34,6 @@ import pekko.japi.function.{ Function => JFunction } | |||
import pekko.stream.Materializer | |||
import pekko.stream.javadsl.{ Keep, Sink, Source } | |||
import pekko.util.ConstantFun | |||
import ch.megard.pekko.http.cors.javadsl.settings.CorsSettings | |||
import ch.megard.pekko.http.cors.javadsl.CorsDirectives |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
0563fb1
to
dd70c28
Compare
Also removes the now unnecessary Snapshot OSS repo, removes other workarounds and updates pekko core to 1.0.0-RC3.