Skip to content

Commit 7f3c067

Browse files
author
Lucas Thomas
committed
SF-3436: Mask HTTP Authorization header
1 parent 388313a commit 7f3c067

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
vendor
22
composer.lock
3+
.idea
4+
*.iml

src/Stackify/Log/Entities/Api/WebRequestDetail.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class WebRequestDetail
88
{
99

1010
const HIDDEN_VALUE = 'X-MASKED-X';
11+
private static $HIDDEN_HEADERS = array('cookie', 'authorization');
1112

1213
/**
1314
* @var string
@@ -188,7 +189,7 @@ private function getHeaders()
188189
}
189190
}
190191
foreach ($headers as $name => $value) {
191-
if ('cookie' === strtolower($name)) {
192+
if (in_array(strtolower($name), self::$HIDDEN_HEADERS)) {
192193
$headers[$name] = self::HIDDEN_VALUE;
193194
}
194195
}

0 commit comments

Comments
 (0)