Skip to content
Snippets Groups Projects
Commit 774c26ee authored by Sebastien ANDRE's avatar Sebastien ANDRE
Browse files

Merge branch 'hotline#129555_mise_a_jour_sets_gallica' into 'hotline'

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

See merge request !3904
parents 8614df6a d9ff1728
Branches
Tags
1 merge request!3904hotline #129555 : fix dc:identifier url protocol in OAI
Pipeline #12728 passed with stage
in 1 hour, 28 minutes, and 11 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