Branch: Tag:

2011-08-19

2011-08-19 08:54:33 by Martin Jonsson <marty@roxen.com>

Make it possible for insert#href et al to ignore unknown Content-Encoding headers.

Rev: server/etc/modules/Roxen.pmod:1.314
Rev: server/modules/tags/additional_rxml.pike:1.56

1:   // This is a roxen pike module. Copyright © 1999 - 2009, Roxen IS.   // - // $Id: Roxen.pmod,v 1.313 2011/08/16 15:26:36 grubba Exp $ + // $Id: Roxen.pmod,v 1.314 2011/08/19 08:54:33 marty Exp $      #include <roxen.h>   #include <config.h>
921:   string low_parse_http_response (mapping(string:string) headers,    string body,    void|mapping(string:mixed) response_map, -  void|int|string on_error) +  void|int|string on_error, +  void|int(0..1) ignore_unknown_ce)   //! Similar to @[parse_http_response], but takes a http response   //! message that has been split into headers in @[headers] and the   //! message body in @[body].   //!   //! The indices in @[headers] are assumed to be in lower case. -  + //! + //! @param ignore_unknown_ce + //! If set, unknown Content-Encoding headers will be ignored and + //! parsing will continue on the verbatim body data.   {    string err_msg;   
967:    body = Gz.inflate(-15)->inflate(body);    break;    default: +  if (!ignore_unknown_ce) {    err_msg = sprintf("Content-Encoding %O not supported.\n", ce);    break proc;    }    } -  +  }       if (!charset) {    // Guess the charset from the content. Adapted from insert#href,