diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-09-18 16:48:09 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-09-18 16:48:09 +0200 |
commit | 6c79252090c7be65c1a0f5a485de75e613af2160 (patch) | |
tree | 0597413648d941e93b34df7d95bf4030f1fc934f /src | |
parent | ddc44ca19ba82b7638a909714122e73b92a5183b (diff) | |
download | n_core-6c79252090c7be65c1a0f5a485de75e613af2160.tar.gz n_core-6c79252090c7be65c1a0f5a485de75e613af2160.zip |
debug statements
Diffstat (limited to 'src')
-rw-r--r-- | src/SimpleHandlers.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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); |