Fork for poking around in the original "client implementation for p≡p update server".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
downloadclient/test_split_url.cc

33 lines
896 B

// this file is under GNU General Public License 3.0
// see LICENSE.txt
#include <iostream>
#include <assert.h>
#include "HTTPSStream.hh"
using namespace std;
using namespace pEp;
int main()
{
auto url = "https://vb@dragon.pibit.ch:443/dingens#bumens";
auto split = split_url(url);
assert(split.protocol == "https");
cout << "protocol: " << split.protocol << "\n";
assert(split.login == "vb");
cout << "login: " << split.login << "\n";
assert(split.password== "");
cout << "password: " << split.password << "\n";
assert(split.host == "dragon.pibit.ch");
cout << "host: " << split.host << "\n";
assert(split.port == "443");
cout << "port: " << split.port << "\n";
assert(split.path == "/dingens");
cout << "path: " << split.path << "\n";
assert(split.hash == "#bumens");
cout << "hash: " << split.hash << "\n";
return 0;
}