Skip to content

Commit

Permalink
Merge pull request #1248 from RoadieHQ/dont-log-internal-url
Browse files Browse the repository at this point in the history
dont log the full url
  • Loading branch information
punkle authored Feb 9, 2024
2 parents 5c3ce69 + f3965a0 commit 5ab358e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-candles-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@roadiehq/scaffolder-backend-module-http-request': patch
---

Don't log the internal backend url.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ describe('http:backstage:request', () => {
body: {},
});
const expectedLog =
"Dry run mode. Skipping non dry-run safe method 'POST' request to http://backstage.tests/api/proxy/foo";
"Dry run mode. Skipping non dry-run safe method 'POST' request to /api/proxy/foo";
await action.handler({
...mockContext,
input: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ export function createHttpBackstageAction(options: {
const dryRunSafeMethods = new Set(['GET', 'HEAD', 'OPTIONS']);
if (ctx.isDryRun === true && !dryRunSafeMethods.has(method)) {
ctx.logger.info(
`Dry run mode. Skipping non dry-run safe method '${method}' request to ${httpOptions.url}`,
`Dry run mode. Skipping non dry-run safe method '${method}' request to ${
queryParams !== '' ? `${input.path}?${queryParams}` : input.path
}`,
);
return;
}
Expand Down

0 comments on commit 5ab358e

Please sign in to comment.