CanvasImage: improve fetching from http and add mime detection.
This commit is contained in:
@@ -272,6 +272,16 @@ std::string Request::hostAndPort() const
|
||||
return u.substr(schemeEnd + 3, hostEnd - (schemeEnd + 3));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
std::string Request::responseMime() const
|
||||
{
|
||||
std::string content_type = _responseHeaders.get("content-type");
|
||||
if( content_type.empty() )
|
||||
return "application/octet-stream";
|
||||
|
||||
return content_type.substr(0, content_type.find(';'));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void Request::setResponseLength(unsigned int l)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user