File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,17 @@ type Account struct {
6464 // orders (required, string): A URL from which a list of orders
6565 // submitted by this account can be fetched via a POST-as-GET
6666 // request, as described in Section 7.1.2.1.
67- Orders string `json:"orders"`
67+ //
68+ // When empty, this field is omitted from JSON encodings since it
69+ // is not in the subset of fields described by the spec for inclusion
70+ // when creating an account (§7.3), but the spec also says in that
71+ // same section: "The server MUST ignore any values provided in the
72+ // "orders" fields in account objects sent by the client." Yet, we
73+ // have reports of non-compliant ACME servers (see
74+ // https://caddy.community/t/failing-to-register-an-acme-account/27220/5)
75+ // so we tighten up our serialization a bit to omit empty Orders,
76+ // even though the spec also says this field is "required".
77+ Orders string `json:"orders,omitempty"`
6878
6979 // In response to new-account, "the server returns this account
7080 // object in a 201 (Created) response, with the account URL
You can’t perform that action at this time.
0 commit comments