getClientCertificates() const=0;
/**
+ * Converts a relative URL into an absolute one based on the properties of the request.
+ *
+ * @param url input URL to convert, will be modified in place
+ */
+ virtual void absolutize(std::string& url) const;
+
+ /**
* Returns a language range to use in selecting language-specific
* content for this request.
* <p>The syntax is that of the HTTP 1.1 Accept-Language header, even
return false;
}
+void GenericRequest::absolutize(string& url) const
+{
+ if (url.empty())
+ url = '/';
+ if (url[0] == '/') {
+ // Compute a URL to the root of the site.
+ const char* scheme = getScheme();
+ string root = string(scheme) + "://" + getHostname();
+ if (!isDefaultPort())
+ root += ":" + lexical_cast<string>(getPort());
+ url = root + url;
+ }
+}
+
void GenericRequest::setLangDefaults(bool langFromClient, const XMLCh* defaultRange)
{
m_langFromClient = langFromClient;
#include <xmltooling/io/GenericRequest.h>
-#include <map>
-#include <string>
-
namespace xmltooling {
#if defined (_MSC_VER)