[cmclasses] r1246 committed - Fixed bug in Net_HTTP_Request::getHeader.

0 views
Skip to first unread message

cmcl...@googlecode.com

unread,
Aug 18, 2015, 3:52:38 PM8/18/15
to cmcl...@googlegroups.com
Revision: 1246
Author: christian.wuerker
Date: Tue Aug 18 19:52:28 2015 UTC
Log: Fixed bug in Net_HTTP_Request::getHeader.

https://code.google.com/p/cmclasses/source/detail?r=1246

Modified:
/trunk/src/Net/HTTP/Request.php

=======================================
--- /trunk/src/Net/HTTP/Request.php Tue Jul 21 20:36:58 2015 UTC
+++ /trunk/src/Net/HTTP/Request.php Tue Aug 18 19:52:28 2015 UTC
@@ -196,9 +196,11 @@
public function getHeader( $name, $strict = TRUE )
{
$header = $this->getHeadersByName( $name, TRUE );
- if( !$header && $strict )
- throw new RuntimeException( sprintf( 'No header set by name "%s"',
$name ) );
- return NULL;
+ if( $header )
+ return $header;
+ if( !$strict )
+ return NULL;
+ throw new RuntimeException( sprintf( 'No header set by name "%s"', $name
) );
}

/**
Reply all
Reply to author
Forward
0 new messages