mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-28 05:49:35 +00:00
Refactoring: moved local variable declarations
This commit is contained in:
@ -889,10 +889,6 @@ Response InternalServer::handle_content(const RequestContext& request)
|
||||
printf("** running handle_content\n");
|
||||
}
|
||||
|
||||
std::string content;
|
||||
|
||||
kiwix::Entry entry;
|
||||
|
||||
const std::string bookName = get_book_name(request);
|
||||
if (bookName.empty())
|
||||
return build_homepage(request);
|
||||
@ -907,6 +903,8 @@ Response InternalServer::handle_content(const RequestContext& request)
|
||||
urlStr = urlStr.substr(1);
|
||||
}
|
||||
|
||||
kiwix::Entry entry;
|
||||
|
||||
try {
|
||||
entry = reader->getEntryFromPath(urlStr);
|
||||
if (entry.isRedirect() || urlStr.empty()) {
|
||||
@ -928,6 +926,8 @@ Response InternalServer::handle_content(const RequestContext& request)
|
||||
printf("mimeType: %s\n", mimeType.c_str());
|
||||
}
|
||||
|
||||
std::string content;
|
||||
|
||||
if ( is_compressible_mime_type(mimeType) ) {
|
||||
zim::Blob raw_content = entry.getBlob();
|
||||
content = string(raw_content.data(), raw_content.size());
|
||||
|
Reference in New Issue
Block a user