@ -806,8 +806,24 @@ static struct MHD_Response* handle_content(RequestContext* request)
zim : : Blob raw_content = entry . getBlob ( ) ;
zim : : Blob raw_content = entry . getBlob ( ) ;
content = string ( raw_content . data ( ) , raw_content . size ( ) ) ;
content = string ( raw_content . data ( ) , raw_content . size ( ) ) ;
/* Special rewrite URL in case of ZIM file use intern *asbolute* url like
* / A / Kiwix */
if ( mimeType . find ( " text/html " ) ! = string : : npos ) {
if ( mimeType . find ( " text/html " ) ! = string : : npos ) {
pthread_mutex_lock ( & regexLock ) ;
content = replaceRegex ( content ,
" $1$2 " + rootLocation + " / " + humanReadableBookId + " /$3/ " ,
" (href|src)(=[ \" | \' ]{0,1})/([A-Z| \\ -])/ " ) ;
content = replaceRegex ( content ,
" $1$2 " + rootLocation + " / " + humanReadableBookId + " /$3/ " ,
" (@import[ ]+)([ \" | \' ]{0,1})/([A-Z| \\ -])/ " ) ;
pthread_mutex_unlock ( & regexLock ) ;
introduceTaskbar ( content , humanReadableBookId ) ;
introduceTaskbar ( content , humanReadableBookId ) ;
} else if ( mimeType . find ( " text/css " ) ! = string : : npos ) {
pthread_mutex_lock ( & regexLock ) ;
content = replaceRegex ( content ,
" $1$2 " + rootLocation + " / " + humanReadableBookId + " /$3/ " ,
" (url|URL)( \\ ([ \" | \' ]{0,1})/([A-Z| \\ -])/ " ) ;
pthread_mutex_unlock ( & regexLock ) ;
}
}
bool deflated
bool deflated