Skip to content

Commit 0a47d9d

Browse files
authored
Merge pull request #15 from rtckit/v0.5.1
v0.5.1
2 parents 0a6ee6c + e9cbcb2 commit 0a47d9d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rtckit/sip",
33
"description": "Parser/Renderer for SIP protocol written in PHP",
4-
"version": "0.5.0",
4+
"version": "0.5.1",
55
"type": "library",
66
"keywords": [
77
"sip",

src/Header/AuthHeader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function render(string $hname): string
233233
}
234234

235235
if (isset($value->algorithm)) {
236-
$params[] = "algorithm=\"{$value->algorithm}\"";
236+
$params[] = "algorithm={$value->algorithm}";
237237
}
238238

239239
if (isset($value->cnonce)) {
@@ -245,7 +245,7 @@ public function render(string $hname): string
245245
}
246246

247247
if (isset($value->nc)) {
248-
$params[] = sprintf('nc=%08s', $value->nc);
248+
$params[] = "nc={$value->nc}";
249249
}
250250

251251
if (isset($value->opaque)) {

tests/Header/AuthHeaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function testShouldRenderWellFormedValues()
178178
$this->assertNotNull($rendered);
179179
$this->assertIsString($rendered);
180180
$this->assertEquals(
181-
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm="MD5",cnonce="7900f98e",qop="auth-int",nc=00000042,opaque="misc"' . "\r\n",
181+
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm=MD5,cnonce="7900f98e",qop="auth-int",nc=42,opaque="misc"' . "\r\n",
182182
$rendered
183183
);
184184

@@ -204,7 +204,7 @@ public function testShouldRenderWellFormedValues()
204204
$this->assertNotNull($rendered);
205205
$this->assertIsString($rendered);
206206
$this->assertEquals(
207-
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm="MD5",cnonce="7900f98e",qop="auth-int",nc=00000042,opaque="misc"' . "\r\n" .
207+
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm=MD5,cnonce="7900f98e",qop="auth-int",nc=42,opaque="misc"' . "\r\n" .
208208
'Authorization: Basic MiScCreds' . "\r\n",
209209
$rendered
210210
);

tests/MessageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public function testShouldRenderWellFormedRequests()
451451
'Authorization: Digest username="bob",realm="atlanta.example.com",nonce="ea9c8e88df84f1cec4341ae6cbe5a359",uri="sips:ss2.biloxi.example.com",response="dfe56131d1958046689d83306477ecc",opaque=""' . "\r\n" .
452452
'Date: Thu, 21 Feb 2002 13:02:03 GMT' . "\r\n" .
453453
'Error-Info: <sip:[email protected]>' . "\r\n" .
454-
'Proxy-Authenticate: Digest realm="atlanta.example.com",nonce="f84f1cec41e6cbe5aea9c8e88d359",stale=FALSE,algorithm="MD5",qop="auth",opaque=""' . "\r\n" .
454+
'Proxy-Authenticate: Digest realm="atlanta.example.com",nonce="f84f1cec41e6cbe5aea9c8e88d359",stale=FALSE,algorithm=MD5,qop="auth",opaque=""' . "\r\n" .
455455
'Proxy-Authorization: Digest username="alice",realm="atlanta.example.com",nonce="wf84f1ceczx41ae6cbe5aea9c8e88d359",uri="sip:[email protected]",response="42ce3cef44b22f50c6a6071bc8",opaque=""' . "\r\n" .
456456
'Record-Route: <sip:ss2.biloxi.example.com;lr>' . "\r\n" .
457457
'MIME-Version: 1.0' . "\r\n" .
@@ -461,7 +461,7 @@ public function testShouldRenderWellFormedRequests()
461461
'Subject: Hello' . "\r\n" .
462462
'User-Agent: RTCKit\\SIP' . "\r\n" .
463463
'Warning: 301 isi.edu "Incompatible network address type \'E.164\'"' . "\r\n" .
464-
'WWW-Authenticate: Digest realm="atlanta.example.com",nonce="84f1c1ae6cbe5ua9c8e88dfa3ecm3459",stale=FALSE,algorithm="MD5",qop="auth",opaque=""' . "\r\n" .
464+
'WWW-Authenticate: Digest realm="atlanta.example.com",nonce="84f1c1ae6cbe5ua9c8e88dfa3ecm3459",stale=FALSE,algorithm=MD5,qop="auth",opaque=""' . "\r\n" .
465465
'X-Custom-Header: Something truly important' . "\r\n\r\n",
466466
$rendered
467467
);

0 commit comments

Comments
 (0)