From 6c79252090c7be65c1a0f5a485de75e613af2160 Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Fri, 18 Sep 2020 16:48:09 +0200 Subject: debug statements --- src/SimpleHandlers.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SimpleHandlers.cpp b/src/SimpleHandlers.cpp index 70b3a8c..323db44 100644 --- a/src/SimpleHandlers.cpp +++ b/src/SimpleHandlers.cpp @@ -214,12 +214,17 @@ json Handler::latexRenderHandler(std::string const &arguments, std::string const std::string file = exec("mktemp"); + std::cout << ("file " + file) << ": " << exec(("file " + file).c_str()) << std::endl; + std::cout << ("ls -lisa " + file) << ": " << exec(("ls -lisa " + file).c_str()) << std::endl; + std::string result = exec(("curl -s 'https://latex.codecogs.com/png.latex?" + url_encode(arguments) + "' " "-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0' " "-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' " "-H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'DNT: 1' -H 'Connection: keep-alive' " "-H 'Upgrade-Insecure-Requests: 1' --output " + file).c_str()); + std::cout << ("ls -lisa " + file) << ": " << exec(("ls -lisa " + file).c_str()) << std::endl; + if (!result.empty()) return simple_response("Error: " + result + "\n" "Please report to an admin", session, false); -- cgit v1.2.3-54-g00ecf