Skip to content

Commit 3915af3

Browse files
committed
reinstate updates-via header
1 parent 4743056 commit 3915af3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

solid/TODO.Notifications

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
TODO:
22
- [ ] advertise the notifications channel in well-known
33
- [ ] advertise the notifications channel in HTTP headers
4-
- [ ] reinstate the updates-via header in HEAD requests, which was removed from solid-crud
54
- [ ] implement function to get subscription in SolidWebhook
65

76
Backlog / later:
@@ -10,9 +9,11 @@ Backlog / later:
109
- [ ] Add support for the rate limit feature.
1110
- [ ] create a solid-notifications-lastsent database table - columns are subscription_id and lastsent;
1211
- [ ] how can we stop sending notifications when read access was revoked?
12+
- [ ] use a background process to send notifications so they are out of bound with requests
1313

1414
Done:
1515
- [v] create a solid-notifications-subscription database table - columns should have: id, webid, path, url, expiry
1616
- [v] add notifications controller
1717
- [v] handle register requests - this must validate that the requestor has read access to the resource;
1818
- [v] handle unregister requests - only the webid that subscribed should be able to unsubscribe
19+
- [v] reinstate the updates-via header in HEAD requests, which was removed from solid-crud

solid/lib/Middleware/SolidCorsMiddleware.php

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

37+
if (strtolower($methodName) == "head") {
38+
$pubsub = getenv("PUBSUB_URL") ?: "http://pubsub:8080";
39+
$response->addHeader('updates-via', $pubsub);
40+
}
41+
3742
return $response;
3843
}
3944
}

0 commit comments

Comments
 (0)