Skip to content

Commit a1d7ad1

Browse files
committed
Specify Warning header usage
Signed-off-by: Jason Hall <jason@chainguard.dev>
1 parent f8afb4b commit a1d7ad1

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

spec.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- [API](#api)
2424
- [Endpoints](#endpoints)
2525
- [Error Codes](#error-codes)
26+
- [Warnings](#warnings)
2627
- [Appendix](#appendix)
2728

2829

@@ -758,6 +759,26 @@ The `code` field MUST be one of the following:
758759
| code-13 | `UNSUPPORTED` | the operation is unsupported |
759760
| code-14 | `TOOMANYREQUESTS` | too many requests |
760761

762+
#### Warnings
763+
764+
Registry implementations MAY include informational warnings in `Warning` headers, as described in [RFC 7234](https://www.rfc-editor.org/rfc/rfc7234#section-5.5).
765+
766+
If included, `Warning` headers MUST specify a `warn-code` of `299` and a `warn-agent` of `-`, and MUST NOT specify a `warn-date` value.
767+
768+
A registry MUST NOT send more than 4096 bytes of warning data from all headers combined.
769+
770+
Example warning headers:
771+
772+
```
773+
Warning: 299 - "Your auth token will expire in 30 seconds."
774+
Warning: 299 - "This registry endpoint is deprecated and will be removed soon."
775+
Warning: 299 - "This image is deprecated and will be removed soon."
776+
```
777+
778+
If a client receives `Warning` response headers, it SHOULD report the warnings to the user in an unobtrusive way.
779+
Clients SHOULD deduplicate warnings from multiple associated responses.
780+
In accordance with RFC 7234, clients MUST NOT take any automated action based on the presence or contents of warnings, only report them to the user.
781+
761782
### Appendix
762783

763784
The following is a list of documents referenced in this spec:

0 commit comments

Comments
 (0)