dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #40881
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20824: Fetching CORS whitelist config inside transaction in CORSFilter
------------------------------------------------------------
revno: 20824
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-10-21 13:33:29 +0200
message:
Fetching CORS whitelist config inside transaction in CORSFilter
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/filter/CorsFilter.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/configuration/DefaultConfigurationService.java 2015-10-21 11:33:29 +0000
@@ -29,6 +29,7 @@
*/
import java.util.Iterator;
+import java.util.Set;
import org.hisp.dhis.common.GenericStore;
import org.springframework.transaction.annotation.Transactional;
@@ -71,4 +72,10 @@
return iterator.hasNext() ? iterator.next() : new Configuration();
}
+
+ @Override
+ public Set<String> getCorsWhitelist()
+ {
+ return getConfiguration().getCorsWhitelist();
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/filter/CorsFilter.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/filter/CorsFilter.java 2015-10-13 09:51:30 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/security/filter/CorsFilter.java 2015-10-21 11:33:29 +0000
@@ -145,7 +145,7 @@
}
return !StringUtils.isEmpty( origin ) && ( localUrl.equals( origin ) ||
- configurationService.getConfiguration().getCorsWhitelist().contains( origin ) );
+ configurationService.getCorsWhitelist().contains( origin ) );
}
@Override