diff options
Diffstat (limited to 'project2/cgi/cgiRequestID.cpp')
-rw-r--r-- | project2/cgi/cgiRequestID.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/project2/cgi/cgiRequestID.cpp b/project2/cgi/cgiRequestID.cpp index da8ad6a..60baa1e 100644 --- a/project2/cgi/cgiRequestID.cpp +++ b/project2/cgi/cgiRequestID.cpp @@ -1,9 +1,8 @@ #include <pch.hpp> #include <variables.h> -#include "cgiEnvironment.h" +#include "cgiRequestContext.h" #include <scriptLoader.h> #include <scriptStorage.h> -#include <appEngine.h> #include <gcrypt.h> #include <scopeObject.h> #include <iomanip> @@ -16,16 +15,16 @@ class CgiRequestID : public VariableImplDyn { { } - VariableType value() const + VariableType value(ExecContext * ec) const { gcry_md_hd_t state; gcry_md_open(&state, GCRY_MD_SHA1, 0); ScopeObject gcryClose([&state] { gcry_md_close(state); }); - auto _env = static_cast<const CgiEnvironment *>(ApplicationEngine::getCurrent()->env()); - gcryApplyString(state, _env->getRedirectURL()); + auto crc = static_cast<const CgiRequestContext *>(ec); + gcryApplyString(state, crc->getRedirectURL()); - _env->applyAllParameters([&state,this](const std::string & name, const std::string & value) { + crc->applyAllParameters([&state, this](const std::string & name, const std::string & value) { gcryApplyString(state, name); gcryApplyString(state, value); }); |