Skip to content

Commit 5c56945

Browse files
authored
Improve hidden fields list (#50)
1 parent 04ab14f commit 5c56945

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The following extra information will be collected:
6565
Additionally, you can specify which HTTP request field values should not be sent to Understand.io.
6666
By default, the following field values will be hidden:
6767
```
68-
UNDERSTAND_HIDDEN_REQUEST_FIELDS=password,access_token,secret_key,token,access_key
68+
UNDERSTAND_HIDDEN_REQUEST_FIELDS=password,password_confirmation,access_token,secret_key,token,access_key
6969
```
7070

7171
If you wish you can publish the configuration file and make desired adjustments. See [Advanced configuration](#advanced-configuration)

src/config/understand-laravel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@
7070
* Field names which values should not be sent to Understand.io
7171
* It applies to POST and GET request parameters
7272
*/
73-
'hidden_fields' => explode(',', env('UNDERSTAND_HIDDEN_REQUEST_FIELDS', 'password,access_token,secret_key,token,access_key')),
73+
'hidden_fields' => explode(',', env('UNDERSTAND_HIDDEN_REQUEST_FIELDS', 'password,password_confirmation,access_token,secret_key,token,access_key')),
7474
];

tests/FieldProviderTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ public function testPostRequestParameters()
171171
$this->assertEquals('[value hidden]', $postData['password']);
172172
}
173173

174+
public function testPasswordConfirmationField()
175+
{
176+
\Illuminate\Support\Facades\Route::post('/', function() {});
177+
178+
$this->call('POST', '/', ['password_confirmation' => 'a']);
179+
180+
$postData = $this->app['understand.fieldProvider']->getPostDataArray();
181+
182+
$this->assertEquals('[value hidden]', $postData['password_confirmation']);
183+
}
184+
174185
public function testJsonRequest()
175186
{
176187
if ( ! method_exists($this, 'json'))

0 commit comments

Comments
 (0)