Branch: Tag:

2009-03-26

2009-03-26 13:51:18 by Jonas Wallden <jonasw@roxen.com>

Restore handling of enforced output encoding even for file formats that
are not text/* (it was borked in r1.212). Updated selection criteria for
content types that allow entity encoding.

Rev: server/base_server/prototypes.pike:1.236

5:   #include <config.h>   #include <module.h>   #include <module_constants.h> - constant cvs_version="$Id: prototypes.pike,v 1.235 2009/03/21 18:43:56 mast Exp $"; + constant cvs_version="$Id: prototypes.pike,v 1.236 2009/03/26 13:51:18 jonasw Exp $";      #ifdef DAV_DEBUG   #define DAV_WERROR(X...) werror(X)
2588:    if (misc->last_modified)    heads["Last-Modified"] = Roxen->http_date(misc->last_modified);    -  if (has_prefix (type, "text/") && !ct_charset_search->match (type)) { +  // Only process output encoding if no "; charset=" suffix is available. +  if (!ct_charset_search->match (type)) {    string charset;       if( stringp(file->data) ) {
2599:    if (sizeof (output_charset) || (String.width(file->data) > 8))    {    int allow_entities = -  has_prefix(type, "text/xml") || -  has_prefix(type, "text/html"); +  (type == "text/xml") || +  (type == "text/html") || +  (type == "application/xml") || +  sscanf(type, "application/%*s+xml");    [charset, file->data] = output_encode( file->data, allow_entities );    }    }