IP/Host on the internet
ex) http://user:password@www.tizen.org:8080/market/Item?12345
url_ = http://user:password@www.tizen.org:8080/market/Item?12345
scheme_ = http
domain_ = www.tizen.org
user_ = user
password_ = password
Link : https://www.w3.org/Addressing/rfc1738.txt
Bug : P161229-04063
Bug : http://suprem.sec.samsung.net/jira/browse/TWF-2753
Change-Id: I71fbc95c5b71cd36c370c3ed34fe6d8176cb21a7
Signed-off-by: Youngmin Yoo <youngmin.yoo@samsung.com>
size_t start_of_domain = scheme_.empty() ?
0 : scheme_.length() + kSchemeIdLen;
size_t end_of_domain = url_.find_first_of('/', start_of_domain);
+ size_t at = url_.find_first_of('@', start_of_domain);
+ if (at < end_of_domain) {
+ start_of_domain = at + 1;
+ }
domain_ =
url_.substr(start_of_domain, end_of_domain == std::string::npos ?
std::string::npos : end_of_domain - start_of_domain);
+ LOGGER(INFO) << "Extract Domain is " << domain_;
}
void URLImpl::ExtractDomainPort() {
* => domain_, path_
*
* If the url does not have specific data, an empty string will be stored
- * in the corresponding variables.
+ * in the corresponding variables.(RFC 1738)
*
- * ex) http://user:password@www.google.co.kr:8080/market/Item?12345
- * url_ = http://user:password@www.google.co.kr:8080/market/Item?12345
+ * ex) http://user:password@www.tizen.org:8080/market/Item?12345
+ * url_ = http://user:password@www.tizen.org:8080/market/Item?12345
* scheme_ = http
- * domain_ = user:password@www.google.co.kr
+ * user_ = user
+ * password_ = password
+ * domain_ = www.tizen.org
* port_ = 8080
* path_ = /market/Item?12345
*/