-
-
Notifications
You must be signed in to change notification settings - Fork 162
FE: Closes #535, allowing to configure cors through spring properties #574
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
base: main
Are you sure you want to change the base?
Changes from all commits
1f9e6f3
cbc8743
0228b5b
5f4b6cb
945add4
1ef3f3b
c011913
8d66ec0
2f6b5c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.kafbat.ui.config; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@ConfigurationProperties(prefix = "cors") | ||
@Data | ||
public class CorsProperties { | ||
|
||
private String allowedOrigins; | ||
private String allowedMethods; | ||
private String allowedHeaders; | ||
private String allowCredentials; | ||
private String maxAge; | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,10 @@ logging: | |
reactor.netty.http.server.AccessLog: INFO | ||
org.hibernate.validator: WARN | ||
|
||
cors: | ||
allowed-origins: "*" | ||
allowed-methods: "GET, PUT, POST, DELETE, OPTIONS" | ||
allowed-headers: "Content-Type" | ||
allow-credentials: "true" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think allowed-origins should be null by default and if it is null we could pass request.getHeaders().getOrigin(). This will keep backward compatibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aditya-baldwa hi, could you address this please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @Haarolean, yes, will check on it |
||
max-age: "3600" | ||
|
Uh oh!
There was an error while loading. Please reload this page.