[New] Added CORS capability as a configuration option
Simply add the property corsEnabled=true and corsOrigin=? to the configuration properties of the RestfulStrolchComponent and then the RestFul API should allow cross origin querying
This commit is contained in:
parent
3b42dfd805
commit
568096063c
|
@ -40,8 +40,9 @@ public class RestfulStrolchComponent extends StrolchComponent {
|
|||
public void initialize(ComponentConfiguration configuration) {
|
||||
|
||||
if (configuration.getBoolean("corsEnabled", Boolean.FALSE)) {
|
||||
AccessControlResponseFilter.setCorsEnabled(true);
|
||||
String origin = configuration.getString("corsOrigin", null);
|
||||
logger.info("Enabling CORS for origin: " + origin);
|
||||
AccessControlResponseFilter.setCorsEnabled(true);
|
||||
AccessControlResponseFilter.setOrigin(origin);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue