def get_cgi_parameter_str_or_none(form: cgi.FieldStorage,
                                  key: str) -> Optional[str]:
    """
    Extracts a string parameter from a CGI form, or ``None`` if the key doesn't
    exist or the string is zero-length.
    """
    s = get_cgi_parameter_str(form, key)
    if s is None or len(s) == 0:
        return None
    return s
Extracts a string parameter from a CGI form, or ``None`` if the key doesn't
    exist or the string is zero-length.