diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cache.c | 3 | ||||
-rw-r--r-- | src/capi.c | 52 | ||||
-rw-r--r-- | src/prefs.c | 1 | ||||
-rw-r--r-- | src/prefs.h | 4 | ||||
-rw-r--r-- | src/prefsparser.cc | 11 |
5 files changed, 1 insertions, 70 deletions
diff --git a/src/cache.c b/src/cache.c index ea9d9a1f..97cbc458 100644 --- a/src/cache.c +++ b/src/cache.c @@ -682,8 +682,7 @@ static void Cache_parse_header(CacheEntry_t *entry) /* 30x: URL redirection */ DilloUrl *location_url = a_Url_new(location_str,URL_STR_(entry->Url)); - if (prefs.filter_auto_requests == PREFS_FILTER_SAME_DOMAIN && - !a_Url_same_organization(entry->Url, location_url)) { + if (0) { /* don't redirect; just show body like usual (if any) */ MSG("Redirection not followed from %s to %s\n", URL_HOST(entry->Url), URL_STR(location_url)); @@ -363,55 +363,6 @@ static void Capi_dpi_send_source(BrowserWindow *bw, DilloUrl *url) } /* - * When dillo wants to open an URL, this can be either due to user action - * (e.g., typing in an URL, clicking a link), or automatic (HTTP header - * indicates redirection, META HTML tag with refresh attribute and 0 delay, - * and images and stylesheets on an HTML page when autoloading is enabled). - * - * For a user request, the action will be permitted. - * For an automatic request, permission to load depends on the filter set - * by the user. - */ -static bool_t Capi_filters_test(const DilloUrl *wanted, - const DilloUrl *requester) -{ - bool_t ret; - - if (requester == NULL) { - /* request made by user */ - ret = TRUE; - } else { - switch (prefs.filter_auto_requests) { - case PREFS_FILTER_SAME_DOMAIN: - { - const char *req_host = URL_HOST(requester), - *want_host = URL_HOST(wanted); - if (want_host[0] == '\0') { - ret = (req_host[0] == '\0' || - !dStrAsciiCasecmp(URL_SCHEME(wanted), "data")) - ? TRUE : FALSE; - } else { - /* This will regard "www.dillo.org" and "www.dillo.org." as - * different, but it doesn't seem worth caring about. - */ - ret = a_Url_same_organization(wanted, requester); - } - if (ret == FALSE) { - MSG("Capi_filters_test: deny from '%s' to '%s'\n", req_host, - want_host); - } - break; - } - case PREFS_FILTER_ALLOW_ALL: - default: - ret = TRUE; - break; - } - } - return ret; -} - -/* * Most used function for requesting a URL. * TODO: clean up the ad-hoc bindings with an API that allows dynamic * addition of new plugins. @@ -427,9 +378,6 @@ int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData) const char *scheme = URL_SCHEME(web->url); int safe = 0, ret = 0, use_cache = 0; - dReturn_val_if_fail((a_Capi_get_flags(web->url) & CAPI_IsCached) || - Capi_filters_test(web->url, web->requester), 0); - /* reload test */ reload = (!(a_Capi_get_flags(web->url) & CAPI_IsCached) || (URL_FLAGS(web->url) & URL_E2EQuery)); diff --git a/src/prefs.c b/src/prefs.c index f243205a..a7fa1bcf 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -41,7 +41,6 @@ void a_Prefs_init(void) prefs.buffered_drawing = 1; prefs.contrast_visited_color = TRUE; prefs.enterpress_forces_submit = FALSE; - prefs.filter_auto_requests = PREFS_FILTER_SAME_DOMAIN; prefs.focus_new_tab = TRUE; prefs.font_cursive = dStrdup(PREFS_FONT_CURSIVE); prefs.font_factor = 1.0; diff --git a/src/prefs.h b/src/prefs.h index f1a3d538..7622aea3 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -26,9 +26,6 @@ extern "C" { /* Panel sizes */ enum { P_tiny = 0, P_small, P_medium }; -enum {PREFS_FILTER_ALLOW_ALL, - PREFS_FILTER_SAME_DOMAIN}; - typedef struct _DilloPrefs DilloPrefs; struct _DilloPrefs { @@ -77,7 +74,6 @@ struct _DilloPrefs { bool_t load_images; bool_t load_stylesheets; bool_t parse_embedded_css; - int filter_auto_requests; int32_t buffered_drawing; char *font_serif; char *font_sans_serif; diff --git a/src/prefsparser.cc b/src/prefsparser.cc index e74b5a6f..aa810b1e 100644 --- a/src/prefsparser.cc +++ b/src/prefsparser.cc @@ -29,7 +29,6 @@ typedef enum { PREFS_INT32, PREFS_DOUBLE, PREFS_GEOMETRY, - PREFS_FILTER, PREFS_PANEL_SIZE } PrefType_t; @@ -56,7 +55,6 @@ int PrefsParser::parseOption(char *name, char *value) { "contrast_visited_color", &prefs.contrast_visited_color, PREFS_BOOL }, { "enterpress_forces_submit", &prefs.enterpress_forces_submit, PREFS_BOOL }, - { "filter_auto_requests", &prefs.filter_auto_requests, PREFS_FILTER }, { "focus_new_tab", &prefs.focus_new_tab, PREFS_BOOL }, { "font_cursive", &prefs.font_cursive, PREFS_STRING }, { "font_factor", &prefs.font_factor, PREFS_DOUBLE }, @@ -166,15 +164,6 @@ int PrefsParser::parseOption(char *name, char *value) a_Misc_parse_geometry(value, &prefs.xpos, &prefs.ypos, &prefs.width, &prefs.height); break; - case PREFS_FILTER: - if (!dStrAsciiCasecmp(value, "same_domain")) - prefs.filter_auto_requests = PREFS_FILTER_SAME_DOMAIN; - else { - if (dStrAsciiCasecmp(value, "allow_all")) - MSG_WARN("prefs: unrecognized value for filter_auto_requests\n"); - prefs.filter_auto_requests = PREFS_FILTER_ALLOW_ALL; - } - break; case PREFS_PANEL_SIZE: if (!dStrAsciiCasecmp(value, "tiny")) prefs.panel_size = P_tiny; |