Open MatthewOwen01 opened 1 year ago
Under some circumstances the contents of script:pre-request can cause the file to be misinterpreted and overwritten when loaded.
Example. The following file will load successfully:
meta { name: courses type: http seq: 1 } get { url: {{base_url}}/courses body: none } headers { Authorization: bearer {{auth_token}} } script:pre-request { const axios = require("axios"); let resp = await axios({ /*REMOVE ME*/method: "POST" ,url: bru.getEnvVar("auth_url") ,headers: {"authorization": "Bearer " + bru.getEnvVar("api_key")}, data: "" }); console.log(resp.data); bru.setVar('auth_token', resp.data); }
However if the comment /*REMOVE ME*/ is removed, the file will not be loaded correctly and instead be replaced with:
/*REMOVE ME*/
meta { name: : courses type: http seq: NaN } post { url: : bru.getEnvVar("auth_url") body: none }
huh, I think this is another one of the bruno lang issues somewhat similar to #294 (although the other one just fails to load)
Under some circumstances the contents of script:pre-request can cause the file to be misinterpreted and overwritten when loaded.
Example. The following file will load successfully:
However if the comment
/*REMOVE ME*/
is removed, the file will not be loaded correctly and instead be replaced with: