diff --git a/VERSIONS_HOTLINE/129555 b/VERSIONS_HOTLINE/129555 new file mode 100644 index 0000000000000000000000000000000000000000..f9b17ff00991e061e94ca3a9b29bb389cffba758 --- /dev/null +++ b/VERSIONS_HOTLINE/129555 @@ -0,0 +1 @@ + - ticket #129555 : Serveur OAI : prise en compte du https pour l'url fournie en dc:identifier \ No newline at end of file diff --git a/library/Class/Notice/DublinCoreVisitor.php b/library/Class/Notice/DublinCoreVisitor.php index 9c672fb20c7726e7336564c15d36f56a35dce89f..7cbfa9246151da9f09e224296c54c7d0bbd30316 100644 --- a/library/Class/Notice/DublinCoreVisitor.php +++ b/library/Class/Notice/DublinCoreVisitor.php @@ -52,8 +52,7 @@ class Class_Notice_DublinCoreVisitor { public function visitClefAlpha($clef) { $this->_identifier = sprintf('oai:%s:%s', $_SERVER['SERVER_NAME'], $clef); - $this->_url_identifier = sprintf('http://%s%s/recherche/viewnotice/clef/%s', - $_SERVER['SERVER_NAME'], BASE_URL, $clef); + $this->_url_identifier = Class_Url::absolute('/recherche/viewnotice/clef/' . $clef); } diff --git a/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php b/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php index 5c2811b3ac94d1cb8956e748393ebb9f8717e814..3feef92be2cf28bb861a8ea5433f704f690c0a9b 100644 --- a/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php +++ b/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php @@ -155,6 +155,35 @@ class OAIControllerListRecordsInZorkSetTest +/** @see 129555 */ +class OAIControllerListRecordsInZorkSetHttpsTest + extends OAIControllerListRecordsInZorkSetTestCase { + protected $_body; + + public function setUp() { + parent::setUp(); + $_SERVER['HTTPS'] = 'on'; + $this->dispatch('/opac/oai/request?verb=ListRecords&metadataPrefix=oai_dc&set=zork'); + } + + + public function tearDown() { + unset($_SERVER['HTTPS']); + parent::tearDown(); + } + + + /** @test */ + public function azkabanDcIdentifierShouldBeRecordUrlInHttps() { + $this->_xpath + ->assertXPathContentContains($this->_response->getBody(), + '//dc:identifier[substring(text(), 1, 8)="https://"]', + '/clef/harrypotter-azkaban'); + } +} + + + class OAIControllerListRecordsInZorkSetWithBadResumptionTokenTest extends OAIControllerListRecordsInZorkSetTestCase {