Skip to content
Snippets Groups Projects
Commit d9ff1728 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #129555 : fix dc:identifier url protocol in OAI

parent a934a355
Branches
Tags
1 merge request!3904hotline #129555 : fix dc:identifier url protocol in OAI
Pipeline #12723 passed with stage
in 50 minutes and 55 seconds
- ticket #129555 : Serveur OAI : prise en compte du https pour l'url fournie en dc:identifier
\ No newline at end of file
......@@ -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);
}
......
......@@ -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 {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment