Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 8214d40

Browse files
committed
Fix content-type for resource exports
This is fixed by using the values provides by Erfurt_Syntax_RdfSerializer, which already include the correct values.
1 parent 94133a7 commit 8214d40

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

application/controllers/ResourceController.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -478,24 +478,9 @@ public function exportAction()
478478

479479
$filename = 'export' . date('Y-m-d_Hi');
480480

481-
switch ($format) {
482-
case 'rdfxml':
483-
$contentType = 'application/rdf+xml';
484-
$filename .= '.rdf';
485-
break;
486-
case 'rdfn3':
487-
$contentType = 'text/rdf+n3';
488-
$filename .= '.n3';
489-
break;
490-
case 'rdfjson':
491-
$contentType = 'application/json';
492-
$filename .= '.json';
493-
break;
494-
case 'turtle':
495-
$contentType = 'application/x-turtle';
496-
$filename .= '.ttl';
497-
break;
498-
}
481+
$formatDescription = Erfurt_Syntax_RdfSerializer::getFormatDescription($format);
482+
$contentType = $formatDescription['contentType'];
483+
$filename .= $formatDescription['fileExtension'];
499484

500485
/*
501486
* Event: allow for adding / deleting statements to the export

0 commit comments

Comments
 (0)