Explorar o código

Add `base64` to the raw message decoding error

Herman Slatman %!s(int64=3) %!d(string=hai) anos
pai
achega
25f4b4014d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      scep/api/api.go

+ 1 - 1
scep/api/api.go

@@ -235,7 +235,7 @@ func decodeMessage(message string, r *http.Request) ([]byte, error) {
 	rawMessage = strings.ReplaceAll(rawMessage, "%3D", "=") // apparently the padding arrives encoded; the others (+, /) not?
 	rawMessage = strings.ReplaceAll(rawMessage, "%3D", "=") // apparently the padding arrives encoded; the others (+, /) not?
 	decodedMessage, err = base64.StdEncoding.DecodeString(rawMessage)
 	decodedMessage, err = base64.StdEncoding.DecodeString(rawMessage)
 	if err != nil {
 	if err != nil {
-		return nil, fmt.Errorf("failed decoding raw message: %w", err)
+		return nil, fmt.Errorf("failed base64 decoding raw message: %w", err)
 	}
 	}
 
 
 	return decodedMessage, nil
 	return decodedMessage, nil