html sanitize
Added a function to sanitize the html
This is for browser side only.
</body>
<script>
+ function sanitizeHTMLEntities (str) {
+ if(str && typeof str === 'string') {
+ str = str.replace(/</g,"&lt;");
+ str = str.replace(/>/g,"&gt;");
+ }
+ return str;
+ }
+
function httpGet(theUrl) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
lastRequest.open("GET", theUrl, true);
lastRequest.onload = function (e) {
if (lastRequest.readyState === 4 && lastRequest.status === 200) {
- let httpResults = JSON.parse(lastRequest.responseText);
+ let sanitizedResponseText = lastRequest.responseText;
+ let httpResults = JSON.parse(sanitizedResponseText);
results.innerHTML = '';
let processingTimeMs = httpResults.processingTimeMs;
