Skip to content

Commit ecf0a07

Browse files
committed
Bugfix for resource route url
1 parent 5e5750d commit ecf0a07

File tree

6 files changed

+5
-9
lines changed

6 files changed

+5
-9
lines changed

Classes/TechDivision/DocViewer/AccessManager.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class AccessManager extends AbstractModuleController
3232
* @return bool
3333
*/
3434
public function isPackageAccessable($packageKey) {
35-
3635
$packages = $this->packageManager->getAvailablePackages();
3736
return isset($packages[$packageKey]);
3837
}

Classes/TechDivision/DocViewer/Controller/ResourceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function rawAction($package, $filePath) {
5656
}
5757

5858
$contentType = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $filePath);
59-
$this->response->setHeader("Content-Type", $contentType);
59+
$this->getControllerContext()->getResponse()->setContentType($contentType);
6060

6161
return file_get_contents($filePath);
6262

Classes/TechDivision/DocViewer/File/Node.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,7 @@ public function setIsParseable($isParseable)
175175
*/
176176
public function getPackageKey()
177177
{
178-
// very dirty workaround, refactoring soon
179-
if(is_string($this->package)) {
180-
return $this->package;
181-
}else {
182-
return $this->package->getPackageKey();
183-
}
178+
return $this->package->getPackageKey();
184179
}
185180

186181
}

Classes/TechDivision/DocViewer/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function buildResourceUrl($node, $path = null, $baseUri = '') {
5353
$path = join("/", $sourcePathElements);
5454
}
5555

56-
return $baseUri . 'neos/techdivision-docviewer/' . $node->getPackageKey() . "/" . self::urlEncodeFilePath($path);
56+
return '/neos/techdivision-docviewer/' . $node->getPackageKey() . "/" . self::urlEncodeFilePath($path);
5757
}
5858

5959
/**

Documentation/Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Some examples:
1212

1313
[Internal link subSubdir](subdir/subSubDir/Reference.md)
1414

15+
[Internal link File](assets/TechDivisionLogo.jpeg)
16+
1517
[External link](https://google.com/)
1618

1719
[Internal link other package](package://Vendor.Package)

0 commit comments

Comments
 (0)