Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
cleaner logs, hide response body for sensitive data
Browse files Browse the repository at this point in the history
  • Loading branch information
taylordowns2000 committed Jul 9, 2020
1 parent c3dafe5 commit a24001e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
6 changes: 2 additions & 4 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ function rawRequest(params) {
params: params
});
error && reject(error);
console.log("\u2713 Request succeeded.");
console.log("Server responded with: \n".concat(JSON.stringify(response, null, 2)));
console.log("\u2713 Request succeeded. (The response body will be available in state.)");
var resp = (0, _Utils.tryJson)(body);
resolve(resp);
});
Expand Down Expand Up @@ -67,8 +66,7 @@ function req(method, params) {
if (error) {
reject(error);
} else {
console.log("\u2713 ".concat(method, " succeeded."));
console.log("Server responded with: \n".concat(JSON.stringify(response, null, 2)));
console.log("\u2713 ".concat(method, " succeeded. (The response body will be available in state.)"));
var resp = (0, _Utils.tryJson)(body);

if (rest.keepCookie) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "language-http",
"version": "2.4.8",
"version": "2.4.9",
"description": "An HTTP request language package for use with Open Function",
"main": "lib/index.js",
"scripts": {
Expand Down
14 changes: 6 additions & 8 deletions src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ export function rawRequest(params) {
error = assembleError({ error, response, params });
error && reject(error);

console.log(`✓ Request succeeded.`);
// console.log(
// `Server responded with: \n${JSON.stringify(response, null, 2)}`
// );
console.log(
`✓ Request succeeded. (The response body will be available in state.)`
);
const resp = tryJson(body);
resolve(resp);
});
Expand Down Expand Up @@ -39,10 +38,9 @@ export function req(method, params) {
if (error) {
reject(error);
} else {
console.log(`✓ ${method} succeeded.`);
// console.log(
// `Server responded with: \n${JSON.stringify(response, null, 2)}`
// );
console.log(
`✓ ${method} succeeded. (The response body will be available in state.)`
);
const resp = tryJson(body);
if (rest.keepCookie) {
const __cookie = j.getCookieString(url);
Expand Down

0 comments on commit a24001e

Please sign in to comment.