Skip to content

Commit 31ff0d8

Browse files
committed
Default loading authorizationSchemes
1 parent 5ee48a5 commit 31ff0d8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/tools/MessageHelper.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Francerz\Http\Tools;
44

55
use Francerz\Http\Headers\AbstractAuthorizationHeader;
6+
use Francerz\Http\Headers\BasicAuthorizationHeader;
7+
use Francerz\Http\Headers\BearerAuthorizationHeader;
68
use InvalidArgumentException;
79
use Psr\Http\Message\MessageInterface;
810
use Psr\Http\Message\RequestInterface;
@@ -74,7 +76,7 @@ public static function setAuthenticationSchemes(array $authenticationSchemesClas
7476
}, $authenticationSchemesClasses);
7577

7678
static::$authenticationSchemesClasses = array_combine($types, $authenticationSchemesClasses);
77-
}
79+
}
7880

7981
public static function getFirstAuthorizationHeader(MessageInterface $message) : ?AbstractAuthorizationHeader
8082
{
@@ -138,4 +140,9 @@ public static function withContent(MessageInterface $message, string $mediaType,
138140
->withBody($body)
139141
->withHeader('Content-Type', $mediaType);
140142
}
141-
}
143+
}
144+
145+
MessageHelper::setAuthenticationSchemes(array(
146+
BasicAuthorizationHeader::class,
147+
BearerAuthorizationHeader::class
148+
));

0 commit comments

Comments
 (0)