Skip to content

Commit

Permalink
Fix leading space when fetch_headers is empty (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanCoding authored Mar 6, 2023
1 parent 1ff566b commit 4b1fb86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/TlsIconTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public function testStorage_Init()
{
$o = new tls_icon();
$this->assertSame([
'fetch_headers' => ' RECEIVED'
'fetch_headers' => 'RECEIVED'
], $o->storage_init([]));
$this->assertSame([
'fetch_headers' => ' RECEIVED'
'fetch_headers' => 'RECEIVED'
], $o->storage_init(['fetch_headers' => null]));
$this->assertSame([
'fetch_headers' => 'foo bar RECEIVED'
Expand Down
2 changes: 1 addition & 1 deletion tls_icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function get_received_header_content($Received_Header)
public function storage_init($p)
{
$headers = isset($p['fetch_headers']) ? $p['fetch_headers'] : '';
$p['fetch_headers'] = trim($headers) . ' ' . strtoupper('Received');
$p['fetch_headers'] = trim(trim($headers) . ' ' . strtoupper('Received'));
return $p;
}

Expand Down

0 comments on commit 4b1fb86

Please sign in to comment.