mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Http_server: Ignore all special pages if empty-string is passed to --http_server.special_pages_safelist
This commit is contained in:
@@ -94,8 +94,13 @@ public class Xoa_boot_mgr {
|
||||
|
||||
// add safelisted Special pages
|
||||
String special_pages_safelist = arg_mgr.Http__special_pages_safelist();
|
||||
if (String_.Len_gt_0(special_pages_safelist)) {
|
||||
if (special_pages_safelist != null) {
|
||||
byte[][] special_pages = Bry_split_.Split(Bry_.new_u8(special_pages_safelist), Byte_ascii.Pipe);
|
||||
|
||||
// --http_server.special_pages_safelist "" should mean ignore all
|
||||
if (special_pages.length == 0) {
|
||||
special_pages = new byte[][] {Bry_.Empty};
|
||||
}
|
||||
for (byte[] special_page : special_pages) {
|
||||
app.Special_regy().Safelist_pages().Add_as_key_and_val(special_page);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Xoa_cmd_arg_mgr {
|
||||
this.http__home_page = arg_mgr.Get_by("http_server_home").Val_as_str_or("home/wiki/Main_Page");
|
||||
this.http__max_clients = arg_mgr.Get_by("http_server.max_clients").Val_as_int_or(0);
|
||||
this.http__max_clients_timeout = arg_mgr.Get_by("http_server.max_clients_timeout").Val_as_int_or(50);
|
||||
this.http__special_pages_safelist = arg_mgr.Get_by("http_server.special_pages_safelist").Val_as_str_or("");
|
||||
this.http__special_pages_safelist = arg_mgr.Get_by("http_server.special_pages_safelist").Val_as_str_or(null);
|
||||
this.gui__home_page = arg_mgr.Get_by("url").Val_as_str_or(null);
|
||||
this.fsys__bin_dir = arg_mgr.Get_by("bin_dir_name").Val_as_str_or(Bin_dir_name());
|
||||
return true;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class Http_server_mgr implements Gfo_invk {
|
||||
// get the url / ttl
|
||||
if (Bry_.Len_eq_0(ttl_bry)) ttl_bry = wiki.Props().Main_page();
|
||||
Xoa_url url = wiki.Utl__url_parser().Parse(ttl_bry);
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, url.To_bry_page_w_anch());
|
||||
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
|
||||
|
||||
// get the page
|
||||
gplx.xowa.guis.views.Xog_tab_itm tab = Gxw_html_server.Assert_tab2(app, wiki); // HACK: assert tab exists
|
||||
|
||||
Reference in New Issue
Block a user