nodejs-native.js (hoppscotch-2.0.0) | : | nodejs-native.js (hoppscotch-2.1.0) | ||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
rawParams, | rawParams, | |||
rawRequestBody, | rawRequestBody, | |||
contentType, | contentType, | |||
headers, | headers, | |||
}) => { | }) => { | |||
const requestString = [] | const requestString = [] | |||
const genHeaders = [] | const genHeaders = [] | |||
requestString.push(`const http = require('http');\n\n`) | requestString.push(`const http = require('http');\n\n`) | |||
requestString.push(`const url = '${url}${pathName}${queryString}';\n`) | requestString.push(`const url = '${url}${pathName}?${queryString}';\n`) | |||
requestString.push(`const options = {\n`) | requestString.push(`const options = {\n`) | |||
requestString.push(` method: '${method}',\n`) | requestString.push(` method: '${method}',\n`) | |||
if (auth === "Basic Auth") { | if (auth === "Basic Auth") { | |||
const basic = `${httpUser}:${httpPassword}` | const basic = `${httpUser}:${httpPassword}` | |||
genHeaders.push( | genHeaders.push( | |||
` "Authorization": "Basic ${window.btoa( | ` "Authorization": "Basic ${window.btoa( | |||
unescape(encodeURIComponent(basic)) | unescape(encodeURIComponent(basic)) | |||
)}",\n` | )}",\n` | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |