UnmarshalCaddyfile sets up the MatchServerName from Caddyfile tokens. Syntax: sni <domains...>
(d *caddyfile.Dispenser)
| 130 | // |
| 131 | // sni <domains...> |
| 132 | func (m *MatchServerName) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { |
| 133 | for d.Next() { |
| 134 | wrapper := d.Val() |
| 135 | |
| 136 | // At least one same-line option must be provided |
| 137 | if d.CountRemainingArgs() == 0 { |
| 138 | return d.ArgErr() |
| 139 | } |
| 140 | |
| 141 | *m = append(*m, d.RemainingArgs()...) |
| 142 | |
| 143 | // No blocks are supported |
| 144 | if d.NextBlock(d.Nesting()) { |
| 145 | return d.Errf("malformed TLS handshake matcher '%s': blocks are not supported", wrapper) |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | return nil |
| 150 | } |
| 151 | |
| 152 | // MatchRegexp is an embeddable type for matching |
| 153 | // using regular expressions. It adds placeholders |
nothing calls this directly
no test coverage detected