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
) );
}
/**