-const char filters_rcs[] = "$Id: filters.c,v 1.181 2014/06/02 06:19:05 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.186 2014/06/12 13:09:03 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
* properly formatted URL and use it for the redirection
* directly.
*
- * According to RFC 2616 section 14.30 the URL
- * has to be absolute and if the user tries:
- * +redirect{shit/this/will/be/parsed/as/pcrs_command.html}
+ * According to (the now obsolete) RFC 2616 section 14.30
+ * the URL has to be absolute and if the user tries:
+ * +redirect{sadly/this/will/be/parsed/as/pcrs_command.html}
* she would get undefined results anyway.
*
+ * RFC 7231 7.1.2 actually allows relative references,
+ * but those start with a leading slash (RFC 3986 4.2) and
+ * thus can't be mistaken for pcrs commands either.
*/
if (*redirection_string == 's')
{
filter_function = pcrs_filter_response;
}
- else if ((csp->content_type & CT_GIF) &&
+ else if ((csp->content_type & CT_GIF) &&
(csp->action->flags & ACTION_DEANIMATE))
{
filter_function = gif_deanimate_response;
* Function : remove_chunked_transfer_coding
*
* Description : In-situ remove the "chunked" transfer coding as defined
- * in rfc2616 from a buffer.
+ * in RFC 7230 4.1 from a buffer. XXX: The implementation
+ * is neither complete nor compliant (TODO #129).
*
* Parameters :
* 1 : buffer = Pointer to the text buffer
content = (content_filter != NULL) ? (*content_filter)(csp) : NULL;
#ifdef FEATURE_EXTERNAL_FILTERS
- if (!list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER]))
+ if ((csp->content_type & CT_TEXT) &&
+ (csp->rlist != NULL) &&
+ !list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER]))
{
struct list_entry *filtername;
size_t size = (size_t)csp->content_length;
* Invalid syntax is fatal.
*
*********************************************************************/
-const static struct forward_spec *get_forward_override_settings(struct client_state *csp)
+static const struct forward_spec *get_forward_override_settings(struct client_state *csp)
{
const char *forward_override_line = csp->action->string[ACTION_STRING_FORWARD_OVERRIDE];
char forward_settings[BUFFER_SIZE];
*/
if ((csp->content_type & CT_TEXT) &&
(csp->rlist != NULL) &&
- (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER])))
+ (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER]) ||
+ !list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER])))
{
return TRUE;
}
return TRUE;
}
- return (!list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER]));
+ return FALSE;
}