/*
- * Copyright 2001-2007 Internet2
+ * Copyright 2001-2009 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "Application.h"
#include "exceptions.h"
#include "ServiceProvider.h"
+#include "SPRequest.h"
#include "handler/RemotedHandler.h"
#include <algorithm>
-#include <log4cpp/Category.hh>
#include <xmltooling/unicode.h>
#ifndef SHIBSP_LITE
using namespace shibsp;
using namespace opensaml;
using namespace xmltooling;
-using namespace log4cpp;
using namespace xercesc;
using namespace std;
m_output.structure();
DDF hdrs = m_output["headers"];
if (hdrs.isnull())
- hdrs = m_output.addmember("headers").structure();
- hdrs.addmember(name).string(value);
+ hdrs = m_output.addmember("headers").list();
+ DDF h = DDF(name).string(value);
+ hdrs.add(h);
}
long RemotedResponse::sendRedirect(const char* url)
{
if (!m_output.isstruct())
m_output.structure();
- m_output.addmember("redirect").string(url);
+ m_output.addmember("redirect").unsafe_string(url);
return HTTPResponse::XMLTOOLING_HTTP_STATUS_MOVED;
}
}
}
+RemotedHandler::RemotedHandler()
+{
+}
+
RemotedHandler::~RemotedHandler()
{
SPConfig& conf = SPConfig::getConfig();
DDF in = DDF(m_address.c_str()).structure();
in.addmember("application_id").string(request.getApplication().getId());
in.addmember("scheme").string(request.getScheme());
- in.addmember("hostname").string(request.getHostname());
+ in.addmember("hostname").unsafe_string(request.getHostname());
in.addmember("port").integer(request.getPort());
in.addmember("content_type").string(request.getContentType().c_str());
in.addmember("content_length").integer(request.getContentLength());
in.addmember("remote_user").string(request.getRemoteUser().c_str());
in.addmember("client_addr").string(request.getRemoteAddr().c_str());
in.addmember("method").string(request.getMethod());
- in.addmember("uri").string(request.getRequestURI());
- in.addmember("url").string(request.getRequestURL());
+ in.addmember("uri").unsafe_string(request.getRequestURI());
+ in.addmember("url").unsafe_string(request.getRequestURL());
in.addmember("query").string(request.getQueryString());
if (headers) {
if (!stricmp(hdr.name(), "Content-Type"))
#endif
request.setContentType(hdr.string());
- request.setResponseHeader(hdr.name(), hdr.string());
+ else
+ request.setResponseHeader(hdr.name(), hdr.string());
hdr = h.next();
}
h = out["redirect"];
istringstream s(h["data"].string());
return make_pair(true, request.sendResponse(s, h["status"].integer()));
}
- return make_pair(false,0);
+ return make_pair(false,0L);
}
HTTPRequest* RemotedHandler::getRequest(DDF& in) const