1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Merge pull request #39 from csaf-poc/improve_tlp_error_message

Improve error message of missing tlp
This commit is contained in:
Sascha L. Teichmann 2022-02-17 10:43:27 +01:00 committed by GitHub
commit a02c1cea6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -180,7 +180,8 @@ func (c *controller) upload(r *http.Request) (interface{}, error) {
// Extract real TLP from document.
if t == tlpCSAF {
if t = tlp(strings.ToLower(ex.tlpLabel)); !t.valid() || t == tlpCSAF {
return nil, fmt.Errorf("not a valid TL: %s", ex.tlpLabel)
return nil, fmt.Errorf(
"valid TLP label missing in document (found '%s')", t)
}
}