/*
* Allow blocking using images as well as HTML.
* If you do not define this then everything is blocked as HTML.
- *
- * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE.
*/
#undef FEATURE_IMAGE_BLOCKING
-/*
- * Detect image requests automatically for MSIE. Will fall back to
- * other image-detection methods (i.e. "+image" permission) for other
- * browsers.
- *
- * You must also define FEATURE_IMAGE_BLOCKING to use this feature.
- *
- * It detects the following header pair as an image request:
- *
- * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
- * Accept: * / *
- *
- * And the following as a HTML request:
- *
- * User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
- * Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, * / *
- *
- * And no, I haven't got that backwards - IE is being weird.
- *
- * Known limitations:
- * 1) If you press shift-reload on a blocked HTML page, you get
- * the image "blocked" page, not the HTML "blocked" page.
- * 2) Once an image "blocked" page has been sent, viewing it
- * in it's own browser window *should* bring up the HTML
- * "blocked" page, but it doesn't. You need to clear the
- * browser cache to get the HTML version again.
- *
- * These limitations are due to IE making inconsistent choices
- * about which "Accept:" header to send.
- */
-#undef FEATURE_IMAGE_DETECT_MSIE
-
/*
* Use PNG instead of GIF for built-in images
*/
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.146 2017/02/20 13:45:14 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.147 2017/02/20 13:47:04 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
1,
#else
0,
-#endif
- },
- {
- "FEATURE_IMAGE_DETECT_MSIE",
-#ifdef FEATURE_IMAGE_DETECT_MSIE
- 1,
-#else
- 0,
#endif
},
{
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl $Id: configure.in,v 1.206 2016/09/27 22:48:28 ler762 Exp $
+dnl $Id: configure.in,v 1.207 2016/12/24 16:00:49 fabiankeil Exp $
dnl
dnl Written by and Copyright (C) 2001-2016 the
dnl Privoxy team. https://www.privoxy.org/
dnl AutoConf Initialization
dnl =================================================================
-AC_REVISION($Revision: 1.206 $)
+AC_REVISION($Revision: 1.207 $)
AC_INIT(jcc.c)
if test ! -f config.h.in; then
AC_DEFINE(FEATURE_STATISTICS)
fi],AC_DEFINE(FEATURE_STATISTICS))
-AC_ARG_ENABLE(ie-images,
-[ --enable-ie-images Enable a quick but not always reliable auto-detect whether requests from
- MS Internet Explorer are for an image or not.],
-[if test $enableval = yes; then
- AC_DEFINE(FEATURE_IMAGE_DETECT_MSIE)
-fi],)
-
AC_ARG_ENABLE(image-blocking,
[ --disable-image-blocking Don't try to figure out whether a request is
for an image or HTML - assume HTML.],
-const char filters_rcs[] = "$Id: filters.c,v 1.202 2016/05/25 10:50:55 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.203 2016/12/24 16:00:49 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Function : is_imageurl
*
- * Description : Given a URL, decide whether it is an image or not,
- * using either the info from a previous +image action
- * or, #ifdef FEATURE_IMAGE_DETECT_MSIE, and the browser
- * is MSIE and not on a Mac, tell from the browser's accept
- * header.
+ * Description : Given a URL, decide whether it should be treated
+ * as image URL or not.
*
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
*
- * Returns : True (nonzero) if URL is an image, false (0)
+ * Returns : True (nonzero) if URL is an image URL, false (0)
* otherwise
*
*********************************************************************/
int is_imageurl(const struct client_state *csp)
{
-#ifdef FEATURE_IMAGE_DETECT_MSIE
- char *tmp;
-
- tmp = get_header_value(csp->headers, "User-Agent:");
- if (tmp && strstr(tmp, "MSIE") && !strstr(tmp, "Mac_"))
- {
- tmp = get_header_value(csp->headers, "Accept:");
- if (tmp && strstr(tmp, "image/gif"))
- {
- /* Client will accept HTML. If this seems counterintuitive,
- * blame Microsoft.
- */
- return(0);
- }
- else
- {
- return(1);
- }
- }
-#endif /* def FEATURE_IMAGE_DETECT_MSIE */
-
return ((csp->action->flags & ACTION_IMAGE) != 0);
}
IP addresses and in the configuration files.
</td>
</tr>
- <tr>
- <td><code>FEATURE_IMAGE_DETECT_MSIE</code></td>
- <td>@if-FEATURE_IMAGE_DETECT_MSIE-then@ Yes @else-not-FEATURE_IMAGE_DETECT_MSIE@ No @endif-FEATURE_IMAGE_DETECT_MSIE@</td>
- <td>Enables automatic detection of image and HTML requests from
- Microsoft Internet Explorer users, overriding the setting of
- +image in the actions file.</td>
- </tr>
<tr>
<td><code>FEATURE_NO_GIFS</code></td>
<td>@if-FEATURE_NO_GIFS-then@ Yes @else-not-FEATURE_NO_GIFS@ No @endif-FEATURE_NO_GIFS@</td>