Skip to content

Commit 17bc111

Browse files
authored
Add Push-Dont-Notify header (#90)
* Add Push-Dont-Notify header * Refine header definition
1 parent 883b9fb commit 17bc111

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
22
mkdir -p build
3-
kramdown-rfc2629 webdav-push.mkd >build/webdav-push.xml && (cd build; xml2rfc --html webdav-push.xml && xml2rfc --text webdav-push.xml && xdg-open webdav-push.html)
3+
kramdown-rfc2629 webdav-push.mkd >build/webdav-push.xml && (cd build; xml2rfc --html webdav-push.xml && xml2rfc --text webdav-push.xml)
4+
5+
echo To view in a browser, run: xdg-open build/webdav-push.html
46

content.mkd

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ The `push-register` element contains:
188188

189189
The `subscription` element specifies a subscription that shall be notified on updates and contains exactly one element with details about a specific subscription type. Within the scope of this document, only the `web-push-subscription` child element is defined (see {{transport-web-push}}).
190190

191-
To specify which updates the client wants to be notified about, it uses the `trigger` element, which itself can contain:
191+
To specify which updates the client wants to be notified about, it uses the `trigger` (((trigger))) element, which itself can contain:
192192

193193
* A `content-update` element to indicate the client's interest in notifications when the contents of the subscribed resource or its members change ("content update").
194194
* A `property-update` element to indicate the client's interest in notifications when the WebDAV properties of the subscribed resource or its members change ("property update").
@@ -317,6 +317,8 @@ A WebDAV-Push server MUST notify registered subscriptions of a subscribed resour
317317
- on a _content update_, if this was requested during subscription registration,
318318
- on a _property update_, if this was requested during subscription registration.
319319

320+
In case of the Web Push transport, this happens over a `POST` request to the subscription (push resource).
321+
320322

321323
## Push Message
322324

@@ -337,6 +339,51 @@ Example:
337339
Here, both the contents and the properties of the resource (or its members, depending on the registered trigger) with topic `O7M1nQ7cKkKTKsoS_j6Z3w` have changed. The new sync-token (after the change) is `http://example.com/sync/10`.
338340

339341

342+
## Suppressing Notifications
343+
344+
A client may not want to receive push notifications for a change that it induces itself. It can indicate this with the `Push-Dont-Notify` header field, which is sent together with the request that causes the change.
345+
346+
Header name: "Push-Dont-Notify"(((Push-Dont-Notify)))
347+
Value syntax in ABNF with #rule extension as defined in {{Section 5.6.1 of RFC9110}}:
348+
349+
Push-Dont-Notify = 1#(quoted-registration-url) / "*"
350+
351+
quoted-registration-url = quoted-string
352+
; absolute push registration URL
353+
354+
A server SHOULD NOT send push notifications that are triggered by the requested operation to the subscriptions of the `Push-Dont-Notify` header.
355+
356+
Because URIs are not per se canonical, the URI MUST be provided in the exact form as it was originally provided by the server in the `Location` header.
357+
358+
Usage of the asterisk value (`*`) requests that the server doesn't send any notifications for the operation.
359+
360+
Multiple values can be provided as a list and/or using multiple lines as described in {{Section 5.2 of RFC9110}}. If the asterisk is used, other values MUST NOT be sent.
361+
362+
Example 1:
363+
364+
PUT /file.txt HTTP/1.1
365+
Host: www.example.com
366+
Push-Dont-Notify: "https://example.com/webdav/subscriptions/io6Efei4ooph"
367+
368+
[…]
369+
370+
HTTP/1.1 201 Created
371+
372+
In this example, the client requests that the server doesn't send a push notification for the change in `file.txt` to the mentioned subscription.
373+
374+
Example 2:
375+
376+
DELETE /file.txt HTTP/1.1
377+
Host: www.example.com
378+
Push-Dont-Notify: *
379+
380+
[…]
381+
382+
HTTP/1.1 204 No Content
383+
384+
Here the client requests that the server doesn't send any push notification in the context of the deletion.
385+
386+
340387
## Rate Limiting
341388

342389
It's possible that a lot of changes occur within a short period of time (like an upload of many contacts or a mass-change of events, especially for a collection with a lot of subscriptions). This can lead to problems when every change results in a push message:
@@ -354,6 +401,8 @@ Servers SHOULD take measures to avoid such problems. These can include:
354401

355402
Such measures MUST not change the overall meaning of the push notifications so that the client can still perform its desired action. For instance, of a series of push messages that contain only content updates and occur shortly after each other, all but the last message can be omitted (the messages are _merged_ into a single one). If one of the push messages signals a property update, it can't be just omitted because the client then wouldn't know that a property update happened. So in that case the server could either send two messages (one merged message for the content updates and one for the property update) or even better a single push message that signals both the content and the property update.
356403

404+
Clients MAY use the `Push-Dont-Notify: *` header to reduce the number of push messages when desired (for instance, for all requests in a batch except the last one). However clients should be aware that it may be possible that the last operation fails and then no push notification is sent at all, so this should be used only when really necessary.
405+
357406

358407
## Removal of Invalid Subscriptions
359408

0 commit comments

Comments
 (0)