Skip to content

Commit 4ccaa5d

Browse files
Work around inability to link to solid.solidWebhook.register
1 parent fbe3126 commit 4ccaa5d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

solid/lib/Middleware/SolidCorsMiddleware.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function afterController($controller, $methodName, Response $response) {
3636

3737
$pubsub = getenv("PUBSUB_URL") ?: "http://pubsub:8080";
3838
$response->addHeader('updates-via', $pubsub);
39+
$response->addHeader('Link', '</.well-known/solid>; rel="http://www.w3.org/ns/solid#storageDescription"');
3940

4041
return $response;
4142
}

solid/lib/WellKnown/SolidHandler.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ public function handle(string $service, IRequestContext $context, ?IResponse $pr
2626
if ($service !== 'solid') {
2727
return $previousResponse;
2828
}
29-
29+
$webhooksRegisterEndpoint = $this->urlGenerator->linkToRoute('solid.solidWebhook.register');
30+
// FIXME: this shouldn't happen:
31+
if (strlen($webhooksRegisterEndpoint) == 0) {
32+
$webhooksRegisterEndpoint = $this->urlGenerator->linkToRoute('solid.app.appLauncher') . 'webhook/register';
33+
}
3034
$body = [
3135
"@context" => [
3236
"https://www.w3.org/ns/solid/notification/v1"
@@ -40,7 +44,7 @@ public function handle(string $service, IRequestContext $context, ?IResponse $pr
4044
[
4145
"id" => "webhookNotification",
4246
"type" => ["WebHookSubscription2022"],
43-
"subscription" => $this->urlGenerator->linkToRoute("solid.soldWebhook.register"),
47+
"subscription" => $webhooksRegisterEndpoint,
4448
"feature" => []
4549
]
4650
]

0 commit comments

Comments
 (0)