in sdk/src/utils/Utils.cc [702:737]
bool AlibabaCloud::OSS::IsValidPlayListName(const std::string &playlistName)
{
if(playlistName.empty())
{
return false;
}else{
if(!IsValidObjectKey(playlistName))
{
return false;
}
if(playlistName.size() < MinLiveChannelPlayListLength ||
playlistName.size() > MaxLiveChannelPlayListLength)
{
return false;
}
std::size_t lastPos = playlistName.find_last_of('.');
std::size_t slashPos = playlistName.find('/');
if(lastPos == std::string::npos ||
slashPos != std::string::npos ||
0 == lastPos || '.' == playlistName[lastPos-1])
{
return false;
}else{
std::string suffix = playlistName.substr(lastPos);
if(suffix.size() < 5)
{
return false;
}
if(ToLower(suffix.c_str()) != ".m3u8")
{
return false;
}
return true;
}
}
}