Skip to content

Commit

Permalink
Patch startsWith functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
tpmccallum committed Jul 15, 2020
1 parent 91c9b50 commit 07e1138
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,8 @@ app.post('/api/run/:wasm_id/:function_name', (req, res) => {
}
if (readyAtZero.fetchable_already_set == false) {
if (function_parameters.hasOwnProperty('SSVM_Fetch')) {
if (JSON.stringify(JSON.parse(JSON.stringify(function_parameters["SSVM_Fetch"]))).startsWith("http")) {
console.log("CHAR AT: " + JSON.stringify(JSON.parse(JSON.stringify(function_parameters["SSVM_Fetch"]))).charAt(1));
if (JSON.stringify(function_parameters["SSVM_Fetch"]).startsWith("http") || JSON.stringify(function_parameters["SSVM_Fetch"]).startsWith("http", 1)) {
console.log("This is a URL");
var temp_obj = {};
temp_obj["GET"] = JSON.stringify(function_parameters["SSVM_Fetch"]);
Expand Down Expand Up @@ -1367,7 +1368,7 @@ app.post('/api/run/:wasm_id/:function_name/bytes', (req, res) => {
}
if (readyAtZero.fetchable_already_set == false) {
if (function_parameters.hasOwnProperty('SSVM_Fetch')) {
if (JSON.stringify(JSON.parse(JSON.stringify(function_parameters["SSVM_Fetch"]))).startsWith("http")) {
if (JSON.stringify(function_parameters["SSVM_Fetch"]).startsWith("http") || JSON.stringify(function_parameters["SSVM_Fetch"]).startsWith("http", 1)) {
console.log("This is a URL");
var temp_obj = {};
temp_obj["GET"] = JSON.stringify(function_parameters["SSVM_Fetch"]);
Expand Down

0 comments on commit 07e1138

Please sign in to comment.