1 #include "ace/INet/HTTPS_URL.h"
3 #if !defined (__ACE_INLINE__)
4 #include "ace/INet/HTTPS_URL.inl"
7 #include "ace/INet/String_IOStream.h"
8 #include "ace/INet/HTTP_ClientRequestHandler.h"
10 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 const char* URL::PROTOCOL
= "https";
18 const ACE_CString
& URL::protocol ()
20 static const ACE_CString
protocol_ (PROTOCOL
);
25 : ACE::HTTP::URL (HTTPS_PORT
)
29 URL::URL (const ACE_CString
& url_string
)
30 : ACE::HTTP::URL (HTTPS_PORT
)
32 this->parse (url_string
);
35 URL::URL (const URL
& url
)
45 URL
& URL::operator =(const URL
& url
)
47 ACE::HTTP::URL::operator=(url
);
51 ACE_CString
URL::get_request_uri () const
53 ACE::IOS::CString_OStream sos
;
55 if (!this->proxy_host_
.empty ())
57 sos
<< this->get_scheme ().c_str () << "://"
58 << ACE::INet::URL_INetBase::get_host ().c_str ();
59 if (ACE::INet::URL_INetBase::get_port () != HTTP_PORT
)
61 sos
<< ':' << ACE::INet::URL_INetBase::get_port ();
65 // if path is empty we're requesting the root
66 sos
<< (this->get_path ().empty () ?
68 this->get_path ().c_str ());
69 if (!this->get_query ().empty ())
70 sos
<< '?' << this->get_query ().c_str ();
71 if (!this->get_fragment ().empty ())
72 sos
<< '#' << this->get_fragment ().c_str ();
76 ACE::INet::ClientRequestHandler
* URL::create_default_request_handler () const
78 ACE::INet::ClientRequestHandler
* prh
= 0;
79 ACE_NEW_NORETURN (prh
, ACE::HTTP::ClientRequestHandler ());
83 const URL::Factory
& URL::factory_
= *URL::TURLFactorySingleton::instance ();
85 URL::Factory::Factory ()
87 ACE::INet::URL_Base::register_factory (this);
90 URL::Factory::~Factory ()
93 const ACE_CString
& URL::Factory::protocol ()
95 return URL::protocol ();
98 ACE::INet::URL_Base
* URL::Factory::create_from_string (const ACE_CString
& url_string
)
101 ACE_NEW_NORETURN (purl
, URL (url_string
));
107 ACE_END_VERSIONED_NAMESPACE_DECL