Skip to content

Commit

Permalink
Fix for multiple values on "Link" header
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceadams committed Jun 13, 2017
1 parent 2724841 commit 6b49f35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function discover_api_root( $uri, $legacy = false ) {
$response = Requests::head( $uri );
$response->throw_for_status();

$links = $response->headers->getValues( 'Link' );
$header_value = $response->headers->getValues( 'Link' );
$links = explode( ',', $header_value[0] );

// Find the correct link by relation
foreach ( $links as $link ) {
Expand Down

0 comments on commit 6b49f35

Please sign in to comment.