X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=filters.c;h=d122d841600beaedd6e737c25f3a9afbd87fc606;hp=878c825312cc77367d5cb8cdc81438ff2525987f;hb=3861790913f2c219faa04a9a2954bfbb4c4c40a5;hpb=5fc8530f3f835fa471fc6819f91d2def4f5e27de diff --git a/filters.c b/filters.c index 878c8253..d122d841 100644 --- a/filters.c +++ b/filters.c @@ -1,4 +1,4 @@ -const char filters_rcs[] = "$Id: filters.c,v 1.123 2009/06/19 15:50:53 fabiankeil Exp $"; +const char filters_rcs[] = "$Id: filters.c,v 1.125 2009/10/25 15:23:40 ler762 Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/filters.c,v $ @@ -689,7 +689,9 @@ struct http_response *block_url(struct client_state *csp) } #endif /* Preceeding code is disabled for now */ } - else if(csp->action->flags & ACTION_HANDLE_AS_EMPTY_DOCUMENT) + else +#endif /* def FEATURE_IMAGE_BLOCKING */ + if(csp->action->flags & ACTION_HANDLE_AS_EMPTY_DOCUMENT) { /* * Send empty document. @@ -700,7 +702,21 @@ struct http_response *block_url(struct client_state *csp) rsp->body = strdup(" "); rsp->content_length = 1; - rsp->status = strdup("403 Request blocked by Privoxy"); + if (csp->config->feature_flags & RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK) + { + /* + * Workaround for firefox bug 492459 + * https://bugzilla.mozilla.org/show_bug.cgi?id=492459 + * Return a 200 OK status for pages blocked with +handle-as-empty-document + * if the "handle-as-empty-doc-returns-ok" runtime config option is set. + */ + rsp->status = strdup("200 Request blocked by Privoxy"); + } + else + { + rsp->status = strdup("403 Request blocked by Privoxy"); + } + if (rsp->status == NULL) { free_http_response(rsp); @@ -717,7 +733,6 @@ struct http_response *block_url(struct client_state *csp) } } else -#endif /* def FEATURE_IMAGE_BLOCKING */ /* * Else, generate an HTML "blocked" message: