mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
HTTP Server: Change url parsing logic to support slashes [#301]
This commit is contained in:
parent
af19381e3c
commit
089661a0bc
@ -104,7 +104,15 @@ public class Http_server_mgr implements Gfo_invk {
|
|||||||
if (Runtime_.Memory_total() > Io_mgr.Len_gb) Xowe_wiki_.Rls_mem(wiki, true); // release memory at 1 GB; DATE:2015-09-11
|
if (Runtime_.Memory_total() > Io_mgr.Len_gb) Xowe_wiki_.Rls_mem(wiki, true); // release memory at 1 GB; DATE:2015-09-11
|
||||||
|
|
||||||
// get the url / ttl
|
// get the url / ttl
|
||||||
if (Bry_.Len_eq_0(ttl_bry)) ttl_bry = wiki.Props().Main_page();
|
// empty title returns main page; EX: "" -> "Main_Page"
|
||||||
|
if (Bry_.Len_eq_0(ttl_bry))
|
||||||
|
ttl_bry = wiki.Props().Main_page();
|
||||||
|
// generate ttl of domain/wiki/page; needed for pages with leading slash; EX: "/abcd" -> "en.wikipedia.org/wiki//abcd"; ISSUE#:301; DATE:2018-12-16
|
||||||
|
else {
|
||||||
|
Bry_bfr tmp_bfr = wiki.Utl__bfr_mkr().Get_m001();
|
||||||
|
tmp_bfr.Add(wiki.Domain_bry()).Add(gplx.xowa.htmls.hrefs.Xoh_href_.Bry__wiki).Add(ttl_bry);
|
||||||
|
ttl_bry = tmp_bfr.To_bry_and_clear_and_rls();
|
||||||
|
}
|
||||||
Xoa_url url = wiki.Utl__url_parser().Parse(ttl_bry);
|
Xoa_url url = wiki.Utl__url_parser().Parse(ttl_bry);
|
||||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, url.To_bry_page_w_anch()); // changed from ttl_bry to page_w_anch; DATE:2017-07-24
|
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, url.To_bry_page_w_anch()); // changed from ttl_bry to page_w_anch; DATE:2017-07-24
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user