diff --git a/src/IIIFManifestParser.php b/src/IIIFManifestParser.php index e837b13..e360aef 100644 --- a/src/IIIFManifestParser.php +++ b/src/IIIFManifestParser.php @@ -87,11 +87,16 @@ public function getTileSources($manifest_url, $access_token = NULL) { try { // Request the manifest. - $manifest_response = $this->httpClient->request('GET', $manifest_url, [ - 'headers' => [ - 'Authorization' => 'Bearer ' . $access_token, - ], - ]); + if (empty($access_token)) { + $manifest_response = $this->httpClient->get($manifest_url); + } + else { + $manifest_response = $this->httpClient->request('GET', $manifest_url, [ + 'headers' => [ + 'Authorization' => 'Bearer ' . $access_token, + ], + ]); + } // Decode the manifest json. $manifest_string = (string) $manifest_response->getBody(); diff --git a/tests/src/Kernel/IIIFManifestParserTest.php b/tests/src/Kernel/IIIFManifestParserTest.php index 1c49f49..5f37d0b 100644 --- a/tests/src/Kernel/IIIFManifestParserTest.php +++ b/tests/src/Kernel/IIIFManifestParserTest.php @@ -210,9 +210,7 @@ public function testGetTileSourcesWithTokens() { $logger ); - $access_token = 'islandora'; - - $tile_sources = $parser->getTileSources('http://example.org/node/[node:nid]/manifest', $access_token); + $tile_sources = $parser->getTileSources('http://example.org/node/[node:nid]/manifest'); $expected = [ 'http://127.0.0.1:8080/cantaloupe/iiif/2/derp.TIF', 'http://127.0.0.1:8080/cantaloupe/iiif/2/derp.jpeg',