Skip to content

Commit bbe4fd0

Browse files
committed
Truncate "image" and "media" params to 32 bytes
(do not show the whole photo in output/request log) (cherry picked from commit 178e1e7)
1 parent ef69e15 commit bbe4fd0

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/Application.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,25 @@ public function __construct(\G4\Runner\RunnerInterface $appRunner = null)
3434
private function getRequestAnonymizationRules()
3535
{
3636
return [
37-
Parameters::X_ND_AUTH => function($value) {
37+
Parameters::X_ND_AUTH => function ($value) {
3838
return substr_replace($value, str_repeat('*', 20), 0, -12);
3939
},
40-
Parameters::X_ND_APP_KEY => function($value) {
40+
Parameters::X_ND_APP_KEY => function ($value) {
4141
return substr_replace($value, str_repeat('*', 20), 0, -12);
4242
},
43-
Parameters::CC_NUMBER => function($value) {
43+
Parameters::CC_NUMBER => function ($value) {
4444
return substr_replace($value, str_repeat('*', 12), 0, -4);
4545
},
4646
Parameters::CC_CVV2 => '***',
4747
Parameters::SESSION => null, // null value will actually unset params key from response
4848
'__site_id' => null,
4949
'__system_type' => null,
50-
'image' => null,
50+
'image' => function ($value) {
51+
return substr($value, 0, 32) . '...';
52+
},
53+
'media' => function ($value) {
54+
return substr($value, 0, 32) . '...';
55+
},
5156
];
5257
}
53-
}
58+
}

0 commit comments

Comments
 (0)