Commit 4813c5ed authored by Jan Koester's avatar Jan Koester
Browse files

test

parent f2cdf241
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#define MAX_RETRIES 5

static std::string cookieDomain(libhttppp::HttpRequest &req)
std::string blogi::cookieDomain(libhttppp::HttpRequest &req)
{
    std::string h;
    auto *fwd = req.getHeaderData("x-forwarded-host");
+7 −0
Original line number Diff line number Diff line
@@ -39,6 +39,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

namespace blogi {

    // Derives the cookie "Domain" attribute from a request (X-Forwarded-Host
    // aware). Exposed (not blogi.cpp-local) so plugins that need to set their
    // own cookies -- e.g. a plugin persisting a session id in its own HTTP
    // response instead of blogi's shared one, see schimmeldoc's login -- can
    // reuse the same logic instead of duplicating/drifting from it.
    std::string cookieDomain(libhttppp::HttpRequest &req);

    struct DomainContext {
        std::string                                     domainName;
        std::string                                     prefix;