Skip to content

Commit

Permalink
AUS-4069 - removed AUS-4265 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvpeters committed Nov 18, 2024
1 parent 9c6b27b commit d4fb59d
Show file tree
Hide file tree
Showing 5 changed files with 1,326 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ public ModelAndView getIRISStations(
}
kml.append("</Document></kml>");

return generateJSONResponseMAV(true, "gml", kml.toString(), null);
// & character needs to be escaped i.e. &amp
String irisResponse = kml.toString().replaceAll("&(?!amp;|apos;|quot;|lt;|gt;)", "&amp;");
return generateJSONResponseMAV(true, "gml", irisResponse, null);
} catch (Exception e) {
return generateJSONResponseMAV(false, e.getMessage(), "Failed.");
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/resources/layers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,14 @@
iris:
selector: [ "1F","https://auspass.edu.au" ]
# Removed until AUS-4069 is fixed
#"seismology-minq":
# name: "MINQ: Mount Isa Northern Queensland"
# description: "The MINQ seismic array feed from AusPass: the Australian Passive Seismic Server."
# group: "Passive Seismic"
# proxyUrl: "getIRISStations.do"
# order: "263"
# iris:
# selector: [ "ZR","https://auspass.edu.au" ]
"seismology-minq":
name: "MINQ: Mount Isa Northern Queensland"
description: "The MINQ seismic array feed from AusPass: the Australian Passive Seismic Server."
group: "Passive Seismic"
proxyUrl: "getIRISStations.do"
order: "263"
iris:
selector: [ "ZR","https://auspass.edu.au" ]
"seismology-eal1":
name: "EAL1: Eastern Australia Linkage"
description: "The EAL1 seismic array feed from AusPass: the Australian Passive Seismic Server."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,24 @@ public void getStationChannels_channelResponseBadXML_ResultantModelHasSuccessSet
// Assert
Assert.assertFalse((Boolean) result.getModel().get("success"));
}

@Test
public void getIRISStations_stationResponseUnescapedAmbersandXML_ResultantModelHasSuccessSetToTrue() {
// Act
// e.g. unescaped & - <Name>Burke & Wills Roadhouse, Stokes, QLD</Name>
ModelAndView result = this.controller.getIRISStations("org/auscope/portal/iris/StationNameContainsUnescapedSpecialCharacter.xml", "");

// Assert
Assert.assertTrue((Boolean) result.getModel().get("success"));
}

@Test
public void getIRISStations_stationResponseEscapedAmbersandXML_ResultantModelHasSuccessSetToTrue() {
// Act
// e.g. unescaped & - <Name>Burke & Wills Roadhouse, Stokes, QLD</Name>
ModelAndView result = this.controller.getIRISStations("org/auscope/portal/iris/StationNameContainsEscapedSpecialCharacter.xml", "");

// Assert
Assert.assertTrue((Boolean) result.getModel().get("success"));
}
}
Loading

0 comments on commit d4fb59d

Please sign in to comment.