MCPcopy
hub / github.com/caddyserver/caddy / UnmarshalJSON

Method UnmarshalJSON

modules/caddypki/acmeserver/challenges.go:33–40  ·  view source on GitHub ↗

The unmarshaller first marshals the value into a string. Then it trims any space around it and lowercase it for normaliztion. The method does not and should not validate the value within accepted enums.

(b []byte)

Source from the content-addressed store, hash-verified

31// trims any space around it and lowercase it for normaliztion. The
32// method does not and should not validate the value within accepted enums.
33func (c *ACMEChallenge) UnmarshalJSON(b []byte) error {
34 var s string
35 if err := json.Unmarshal(b, &s); err != nil {
36 return err
37 }
38 *c = ACMEChallenge(strings.ToLower(strings.TrimSpace(s)))
39 return nil
40}
41
42// String returns a string representation of the challenge.
43func (c ACMEChallenge) String() string {

Callers

nothing calls this directly

Calls 1

ACMEChallengeTypeAlias · 0.85

Tested by

no test coverage detected