Branch: Tag:

2018-02-20

2018-02-20 11:08:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Testsuite [WebDAV]: Improved base_url handling.

Fixes issues with ports with fragment URLs.

Fixes support for webdav_mount_point being an absolute path.

Fixes some more of [WS-168].

243:       // Run the suite once with every http protocol modules in the conf.    // This allows for testing such things as sub-path mounted sites etc. -  foreach(conf->registered_urls, string url) { +  foreach(conf->registered_urls, string full_url) {    mapping(string:string|Configuration|array(Protocol)) port_info = -  roxen.urls[url]; +  roxen.urls[full_url];    if (!test_true(mappingp, port_info)) continue;    array(Protocol) ports = port_info->ports;    if (!test_true(arrayp, ports)) continue;
256:    if (prot->bound != 1) continue;       if (!test_true(mappingp, prot->urls)) continue; +  +  // Strip the fragment from the full_url. +  string url = (full_url/"#")[0];    mapping(string:mixed) url_data = prot->urls[url];    if (!test_true(mappingp, url_data)) continue;    report_debug("url data: %O\n", url_data);
266:       Standards.URI url_uri = Standards.URI(url, "http://*/");    base_uri = -  Standards.URI((url_data->path || "/") + webdav_mount_point, url_uri); +  Standards.URI(Stdio.append_path(url_data->path || "/", +  webdav_mount_point), url_uri);    base_uri->port = prot->port;    base_uri->host = prot->ip;