Purpose : Used with other docs and files only.
- $Id: p-config.sgml,v 2.54 2009/11/27 13:47:34 fabiankeil Exp $
+ $Id: p-config.sgml,v 2.55 2009/12/15 17:43:40 fabiankeil Exp $
Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/
See LICENSE.
Sample Configuration File for Privoxy v&p-version;
</title>
<para>
- $Id: p-config.sgml,v 2.54 2009/11/27 13:47:34 fabiankeil Exp $
+ $Id: p-config.sgml,v 2.55 2009/12/15 17:43:40 fabiankeil Exp $
</para>
<para>
Copyright (C) 2001-2009 Privoxy Developers http://www.privoxy.org/
</sect3>
+<sect3 renderas="sect4" id="handle-as-empty-doc-returns-ok"><title>handle-as-empty-doc-returns-ok</title>
+<variablelist>
+ <varlistentry>
+ <term>Note:</term>
+ <listitem>
+ <para>
+ This is a work-around for Firefox bug 492459:
+ <quote>
+ Websites are no longer rendered if SSL requests for JavaScripts are blocked by a proxy.
+ </quote>
+ (<link linkend="https://bugzilla.mozilla.org/show_bug.cgi?id=492459">
+ https://bugzilla.mozilla.org/show_bug.cgi?id=492459</link>)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Specifies:</term>
+ <listitem>
+ <para>
+ The status code Privoxy returns for pages blocked with
+ <literal><link linkend="handle-as-empty-document">+handle-as-empty-document</link></literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Type of value:</term>
+ <listitem>
+ <para>
+ <replaceable>0 or 1</replaceable>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Default value:</term>
+ <listitem>
+ <para>0</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Effect if unset:</term>
+ <listitem>
+ <para>
+ Privoxy returns a status 403(forbidden) for all blocked pages.
+ </para>
+ </listitem>
+ <term>Effect if set:</term>
+ <listitem>
+ <para>
+ Privoxy returns a status 200(OK) for pages blocked with +handle-as-empty-document
+ and a status 403(Forbidden) for all other blocked pages.
+ </para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+<![%config-file;[<literallayout>@@#handle-as-empty-doc-returns-ok 0</literallayout>]]>
+</sect3>
+
+
</sect2>
<!-- ~ End section ~ -->
-const char filters_rcs[] = "$Id: filters.c,v 1.124 2009/08/19 15:24:30 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 $
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);
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.107 2009/11/27 13:46:47 fabiankeil Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.108 2010/01/03 12:37:14 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
#define hash_forward_socks4a 2639958518ul /* "forward-socks4a" */
#define hash_forward_socks5 3963965522ul /* "forward-socks5" */
#define hash_forwarded_connect_retries 101465292ul /* "forwarded-connect-retries" */
+#define hash_handle_as_empty_returns_ok 1444873247ul /* "handle-as-empty-doc-returns-ok" */
#define hash_hostname 10308071ul /* "hostname" */
#define hash_keep_alive_timeout 3878599515ul /* "keep-alive-timeout" */
#define hash_listen_address 1255650842ul /* "listen-address" */
config->feature_flags &= ~RUNTIME_FEATURE_CGI_TOGGLE;
config->feature_flags &= ~RUNTIME_FEATURE_SPLIT_LARGE_FORMS;
config->feature_flags &= ~RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS;
+ config->feature_flags &= ~RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK;
configfp = fopen(configfile, "r");
if (NULL == configfp)
config->forwarded_connect_retries = atoi(arg);
break;
+/* *************************************************************************
+ * handle-as-empty-doc-returns-ok 0|1
+ *
+ * Workaround for firefox hanging on blocked javascript pages.
+ * Block with the "+handle-as-empty-document" flag and set the
+ * "handle-as-empty-doc-returns-ok" run-time config flag so that
+ * Privoxy returns a 200/OK status instead of a 403/Forbidden status
+ * to the browser for blocked pages.
+ ***************************************************************************/
+ case hash_handle_as_empty_returns_ok:
+ if ((*arg != '\0') && (0 != atoi(arg)))
+ {
+ config->feature_flags |= RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK;
+ }
+ else
+ {
+ config->feature_flags &= ~RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK;
+ }
+ break;
+
/* *************************************************************************
* hostname hostname-to-show-on-cgi-pages
* *************************************************************************/
#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
/** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.152 2009/11/08 17:54:09 ler762 Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.153 2009/11/27 13:46:47 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
/** configuration_spec::feature_flags: Share outgoing connections between different client connections. */
#define RUNTIME_FEATURE_CONNECTION_SHARING 256U
+/** configuration_spec::feature_flags: Pages blocked with +handle-as-empty-doc get a return status of 200 OK. */
+#define RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK 512U
+
/**
* Data loaded from the configuration file.
*
* - RUNTIME_FEATURE_CGI_CRUNCHING
* - RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE
* - RUNTIME_FEATURE_CONNECTION_SHARING
+ * - RUNTIME_FEATURE_EMPTY_DOC_RETURNS_OK
*/
unsigned feature_flags;