Skip to content

Commit 689b890

Browse files
committed
feat: digest auth - fix tests
1 parent ce65e69 commit 689b890

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Generators/DigestAuth.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,27 @@ public function generate(): string
4545

4646
private function generateResponse(): string
4747
{
48-
$closure = $this->data->algorithm->func();
48+
$func = $this->data->algorithm->func();
4949

50-
$ha1 = $closure(sprintf('%s:%s:%s', $this->data->username, $this->data->realm, $this->data->password));
50+
$ha1 = $func(sprintf('%s:%s:%s', $this->data->username, $this->data->realm, $this->data->password));
5151

5252
if ($this->data->algorithm->isSessionVariant()) {
53-
$ha1 = $closure(sprintf('%s:%s:%s', $ha1, $this->data->nonce, $this->data->cnonce));
53+
$ha1 = $func(sprintf('%s:%s:%s', $ha1, $this->data->nonce, $this->data->cnonce));
5454
}
5555

5656
if ($this->data->qop === 'auth-int') {
57-
$ha2 = $closure(sprintf(
57+
$ha2 = $func(sprintf(
5858
'%s:%s:%s',
5959
$this->data->method,
6060
$this->data->uri,
61-
$closure($this->data->entityBody)
61+
$func($this->data->entityBody)
6262
));
6363
} else {
64-
$ha2 = $closure(sprintf('%s:%s', $this->data->method, $this->data->uri));
64+
$ha2 = $func(sprintf('%s:%s', $this->data->method, $this->data->uri));
6565
}
6666

6767
if ($this->data->qop !== '' && $this->data->qop !== '0') {
68-
return $closure(sprintf(
68+
return $func(sprintf(
6969
'%s:%s:%s:%s:%s:%s',
7070
$ha1,
7171
$this->data->nonce,
@@ -76,6 +76,6 @@ private function generateResponse(): string
7676
));
7777
}
7878

79-
return $closure("{$ha1}:{$this->data->nonce}:{$ha2}");
79+
return $func("{$ha1}:{$this->data->nonce}:{$ha2}");
8080
}
8181
}

0 commit comments

Comments
 (0)