Skip to content

Commit

Permalink
[GEOS-8613] Follow up, be tolerant to spaces at the beginning/end of …
Browse files Browse the repository at this point in the history
…the rule
  • Loading branch information
aaime committed May 4, 2018
1 parent d36f4e3 commit 0b3e8c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private PriorityProvider getPriorityProvider(Properties p) {
if ("ows.priority.http".equals(key)) {
String error = "";
try {
String[] splitValue = value.split("\\s*,\\s*");
String[] splitValue = value.trim().split("\\s*,\\s*");
if (splitValue.length == 2 && splitValue[0].length() > 0) {
String httpHeaderName = splitValue[0];
int defaultPriority = Integer.parseInt(splitValue[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,22 @@ public void testParsingPriority() throws Exception {
p.put("ows.wms", "6");
p.put("ows.wfs.getFeature", "12");

checkPriorityParsing(p);
}

@Test
public void testParsingPriorityWithSpaces() throws Exception {
Properties p = new Properties();
p.put("timeout", "10");
p.put("ows.global", "100");
p.put("ows.priority.http", " gs-priority , 3 ");
p.put("ows.wms", "6");
p.put("ows.wfs.getFeature", "12");

checkPriorityParsing(p);
}

private void checkPriorityParsing(Properties p) throws Exception {
DefaultControlFlowConfigurator configurator = new DefaultControlFlowConfigurator(
new FixedWatcher(p));
assertTrue(configurator.isStale());
Expand Down

0 comments on commit 0b3e8c9

Please sign in to comment.