Skip to content

Commit

Permalink
docs(readme): improve the usage example of transform option
Browse files Browse the repository at this point in the history
closes #174
  • Loading branch information
derevnjuk committed Feb 1, 2023
1 parent b8f96f1 commit 61b587e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,18 @@ Here's a simple example of what the `remove-sensitive-data.ts` module might look
```ts
import { Entry } from 'har-format';

const PASSWORD_REGEXP = /\"password":.*?(?=,)/g;
const PASSWORD_REGEXP = /"password":.*?(?=,)/g;

export default async (entry: Entry) => {
try {
// Remove sensitive information from the request and response bodies
entry.request.postData.text = entry.request.postData.text.replace(
PASSWORD_REGEXP,
`"password": "***"`
`"password":"***"`
);
entry.response.content.text = entry.response.content.text.replace(
PASSWORD_REGEXP,
`"password": "***"`
`"password":"***"`
);
return entry;
} catch {
Expand Down

0 comments on commit 61b587e

Please sign in to comment.