Skip to content

Commit 6d06017

Browse files
committed
only send updates via if pubsub is sent
1 parent 37fcd20 commit 6d06017

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

solid/lib/Middleware/SolidCorsMiddleware.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ public function afterController($controller, $methodName, Response $response) {
3434
$response->addHeader('Access-Control-Expose-Headers', $corsExposeHeaders);
3535
$response->addHeader('Accept-Patch', 'text/n3');
3636

37-
$pubsub = getenv("PUBSUB_URL") ?: "http://pubsub:8080";
38-
$response->addHeader('updates-via', $pubsub);
37+
$pubsub = getenv("PUBSUB_URL");
38+
if ($pubsub) {
39+
$response->addHeader('updates-via', $pubsub);
40+
}
3941
$linkHeaders = '</.well-known/solid>; rel="http://www.w3.org/ns/solid#storageDescription"';
4042
$existingHeaders = $response->getHeaders();
4143
if (isset($existingHeaders['Link'])) { // careful - this dictionary key is case sensitive here

0 commit comments

Comments
 (0)