httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ICS.UCI.EDU>
Subject [PATCH]: "ErrorDocument "somestring
Date Thu, 23 Jan 1997 21:35:04 GMT
> Date: Tue Jan 21 17:29:16 1997
> From: chris@i-planet.com
> To: apache-bugs%apache.org@organic.com
> Subject: [BUG]: "ErrorDocument "somestring -- outputs the " though
>                  it's not supposed to!" on FreeBSD

The code for ErrorDocument did not take into account the pre-1.2
changes to how index_of_response handles errors.  This patch fixes
that as well as removing the reported problem of stripping a trailing
double-quote character.

....Roy

Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_core.c,v
retrieving revision 1.58
diff -c -r1.58 http_core.c
*** http_core.c	1997/01/20 04:28:08	1.58
--- http_core.c	1997/01/23 21:27:10
***************
*** 416,422 ****
  const char *set_error_document (cmd_parms *cmd, core_dir_config *conf,
  				char *line)
  {
!     int error_number, index_number;
      char *w;
                  
      /* 1st parameter should be a 3 digit number, which we recognize;
--- 416,422 ----
  const char *set_error_document (cmd_parms *cmd, core_dir_config *conf,
  				char *line)
  {
!     int error_number, index_number, idx500;
      char *w;
                  
      /* 1st parameter should be a 3 digit number, which we recognize;
***************
*** 425,439 ****
    
      w = getword_conf_nc (cmd->pool, &line);
      error_number = atoi(w);
!     index_number = index_of_response(error_number);
!   
!     if (index_number < 0)
!         return pstrcat (cmd->pool, "Illegal HTTP response code ", w, NULL);
                  
-     /* Nuke trailing '"', if present */
-     
-     if (line[strlen(line) - 1] == '"') line[strlen(line) - 1] = '\0';
-   
      /* Store it... */
  
      conf->response_code_strings[index_number] = pstrdup (cmd->pool, line);
--- 425,438 ----
    
      w = getword_conf_nc (cmd->pool, &line);
      error_number = atoi(w);
! 
!     idx500 = index_of_response(HTTP_INTERNAL_SERVER_ERROR);
! 
!     if (error_number == HTTP_INTERNAL_SERVER_ERROR)
!         index_number = idx500;
!     else if ((index_number = index_of_response(error_number)) == idx500)
!         return pstrcat(cmd->pool, "Unsupported HTTP response code ", w, NULL);
                  
      /* Store it... */
  
      conf->response_code_strings[index_number] = pstrdup (cmd->pool, line);

Mime
View raw message