Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/browser_reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function reportResultToServer(result, port) {
out(`RESULT: ${result}`);
} else {
let doFetch = typeof origFetch != 'undefined' ? origFetch : fetch;
doFetch(`http://localhost:${port}/report_result?${result}`).then(() => {
doFetch(`http://localhost:${port}/report_result?${encodeURIComponent(result)}`).then(() => {
if (typeof window === 'object' && window && hasModule && !Module['pageThrewException']) {
/* for easy debugging, don't close window on failure */
window.close();
Expand All @@ -24,7 +24,7 @@ function reportResultToServer(result, port) {
}

function sendFileToServer(filename, contents) {
fetch(`http://localhost:8888/?file=${filename}`, {method: "POST", body: contents});
fetch(`http://localhost:8888/?file=${encodeURIComponent(filename)}`, {method: "POST", body: contents});
}

/**
Expand All @@ -39,7 +39,7 @@ function reportErrorToServer(message) {
if (typeof ENVIRONMENT_IS_NODE !== 'undefined' && ENVIRONMENT_IS_NODE) {
err(message);
} else {
fetch(encodeURI(`http://localhost:8888?stderr=${message}`));
fetch(`http://localhost:8888?stderr=${encodeURIComponent(message)}`);
}
}

Expand Down
Loading