virtual int getPort() const=0;
/**
+ * Returns true iff the request port is the default port for the request protocol.
+ *
+ * @return default port indicator
+ */
+ virtual bool isDefaultPort() const;
+
+ /**
* Returns the MIME type of the request, if known.
*
* @return the MIME type, or an empty string
{
}
+bool GenericRequest::isDefaultPort() const
+{
+ return false;
+}
+
void GenericRequest::setLangDefaults(bool langFromClient, const XMLCh* defaultRange)
{
m_langFromClient = langFromClient;
return strcmp(getScheme(),"https")==0;
}
+bool HTTPRequest::isDefaultPort() const
+{
+ if (isSecure())
+ return getPort() == 443;
+ else
+ return getPort() == 80;
+}
+
string HTTPRequest::getLanguageRange() const
{
return getHeader("Accept-Language");