Skip to content

Commit

Permalink
Merge pull request #306 from openzim/dump_redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Jun 29, 2022
2 parents 9443091 + 98ae5dc commit 92fc9c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zimdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ inline void write_to_file(const std::string &base, const std::string& path, cons

void ZimDumper::writeHttpRedirect(const std::string& directory, const std::string& outputPath, const std::string& currentEntryPath, std::string redirectPath)
{
redirectPath = computeRelativePath(currentEntryPath, redirectPath);
const auto content = httpRedirectHtml(redirectPath);
write_to_file(directory + SEPARATOR, outputPath, content.c_str(), content.size());
}
Expand Down Expand Up @@ -313,6 +312,7 @@ void ZimDumper::dumpFiles(const std::string& directory, bool symlinkdump, std::f
if (entry.isRedirect()) {
auto redirectItem = entry.getItem(true);
std::string redirectPath = redirectItem.getPath();
redirectPath = computeRelativePath(path, redirectPath);
if (symlinkdump == false && redirectItem.getMimetype() == "text/html") {
writeHttpRedirect(directory, relative_path, path, redirectPath);
} else {
Expand Down

0 comments on commit 92fc9c7

Please sign in to comment.