Skip to content

Commit 70abe0d

Browse files
advertise both websockets and webhooks
1 parent b2d59b5 commit 70abe0d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

solid/lib/WellKnown/SolidHandler.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use OCP\IConfig;
88

99
use OCP\AppFramework\Http\JSONResponse;
10+
use OCP\Http\WellKnown\GenericResponse;
1011
use OCP\Http\WellKnown\IHandler;
1112
use OCP\Http\WellKnown\IRequestContext;
1213
use OCP\Http\WellKnown\IResponse;
@@ -34,14 +35,19 @@ public function handle(string $service, IRequestContext $context, ?IResponse $pr
3435
[
3536
"id" => "websocketNotification",
3637
"type" => ["WebSocketSubscription2021"],
37-
"subscription" => "https://websocket.example/subscription",
38-
"feature" => ["state", "rate", "expiration"]
38+
"feature" => []
39+
],
40+
[
41+
"id" => "webhookNotification",
42+
"type" => ["WebHookSubscription2022"],
43+
"subscription" => $this->urlGenerator->linkToRoute("solid.soldWebhook.register"),
44+
"feature" => []
3945
]
4046
]
41-
];
47+
];
4248
$result = new JSONResponse($body);
4349
$result->addHeader("Access-Control-Allow-Origin", "*");
4450
$result->setStatus(200);
45-
return $result;
51+
return new GenericResponse($result);
4652
}
4753
}

0 commit comments

Comments
 (0)