mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
use system utility for string finds
This commit is contained in:
parent
ca73534d7e
commit
d9f991ed2f
16 changed files with 111 additions and 112 deletions
|
@ -377,11 +377,7 @@ int SrsHttpFileServer::serve_file(ISrsHttpResponseWriter* w, ISrsHttpMessage* r,
|
|||
}
|
||||
|
||||
if (true) {
|
||||
size_t pos;
|
||||
std::string ext = fullpath;
|
||||
if ((pos = ext.rfind(".")) != string::npos) {
|
||||
ext = ext.substr(pos);
|
||||
}
|
||||
std::string ext = srs_path_filext(fullpath);
|
||||
|
||||
if (_mime.find(ext) == _mime.end()) {
|
||||
w->header()->set_content_type("application/octet-stream");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue