OfflineHTTPProtocol mapping (#2993)

* OfflineHTTPProtocol mapping, fixes #2988

* Reject not mapped protocols

Co-authored-by: Víctor Zamanillo <victor.zamanillo@cifraeducacion.com>
dev
Víctor 2022-12-11 13:04:25 +01:00 committed by GitHub
parent 0e35133ad5
commit b77787e9bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -157,7 +157,11 @@ func (protocolTypes *ProtocolTypes) UnmarshalYAML(unmarshal func(interface{}) er
func (protocolTypes ProtocolTypes) String() string {
var stringTypes []string
for _, t := range protocolTypes {
stringTypes = append(stringTypes, t.String())
protocolMapping := t.String()
if protocolMapping != "" {
stringTypes = append(stringTypes, protocolMapping)
}
}
return strings.Join(stringTypes, ", ")
}