httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@decus.org (Rodent of Unusual Size)
Subject [PATCH] Adding DOCTYPEs to server-generated HTML
Date Tue, 11 Feb 1997 01:35:33 GMT
    Obsessing for a moment, I took a quick scan through the source for
    server-generated HTML syntax.  I found a couple of places where we
    didn't bracket with <HTML></HTML> tags, and nowhere was there a
    <!DOCTYPE> to be seen.  Here are a couple of patches (mod_dir,
    mod_status, and http_protocol) to add these missing pieces.

    These are basically cosmetic, although I suppose a case could be
    made that mod_status' use of tables w/o a 3.2 DOCTYPE is a bug.. <g>

    #ken    :-)}

Index: mod_dir.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_dir.c,v
retrieving revision 1.21
diff -c -r1.21 mod_dir.c
*** 1.21	1997/02/08 00:39:22
--- mod_dir.c	1997/02/11 01:35:02
***************
*** 715,722 ****
      while (title_endp > title_name && *title_endp == '/')
  	*title_endp-- = '\0';
      
!     rvputs(r, "<HEAD><TITLE>Index of ", title_name, "</TITLE></HEAD><BODY>\n",
! 	   NULL);
  
      if((!(tmp = find_header(dir_conf,r))) || (!(insert_readme(name,tmp,0,r))))
          rvputs(r, "<H1>Index of ", title_name, "</H1>\n", NULL);
--- 715,729 ----
      while (title_endp > title_name && *title_endp == '/')
  	*title_endp-- = '\0';
      
!     rvputs
! 	(
! 	    r,
! 	    "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n",
! 	    "<HTML>\n<HEAD>\n<TITLE>Index of ",
! 	    title_name,
! 	    "</TITLE>\n</HEAD>\n<BODY>\n",
! 	    NULL
! 	);
  
      if((!(tmp = find_header(dir_conf,r))) || (!(insert_readme(name,tmp,0,r))))
          rvputs(r, "<H1>Index of ", title_name, "</H1>\n", NULL);
***************
*** 759,765 ****
          rputs("</UL>", r);
      }
  
!     rputs("</BODY>", r);
      return 0;
  }
  
--- 766,772 ----
          rputs("</UL>", r);
      }
  
!     rputs ("</BODY>\n</HTML>", r);
      return 0;
  }
  
Index: mod_status.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_status.c,v
retrieving revision 1.41
diff -c -b -r1.41 mod_status.c
*** 1.41	1997/01/25 22:57:19
--- mod_status.c	1997/02/11 03:33:11
***************
*** 306,314 ****
  
      if (!short_report)
      {
!         rputs("<html><head><title>Apache Status</title></head><body>\n",r);
!         rputs("<h1>Apache Server Status for ",r);
! 	rvputs(r,server->server_hostname,"</h1>\n\n",NULL);
  	rvputs(r,"Current Time: ",asctime(localtime(&nowtime)),"<br>\n",NULL);
  	rvputs(r,"Restart Time: ",asctime(localtime(&restart_time)),"<br>\n",
  	       NULL);
--- 306,315 ----
  
      if (!short_report)
      {
! 	rputs ("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 3.2//EN\">\n", r);
!         rputs("<HTML>\n<HEAD>\n<TITLE>Apache Status</TITLE>\n</HEAD>\n<BODY>\n",r);
!         rputs("<H1>Apache Server Status for ",r);
! 	rvputs(r,server->server_hostname,"</H1>\n\n",NULL);
  	rvputs(r,"Current Time: ",asctime(localtime(&nowtime)),"<br>\n",NULL);
  	rvputs(r,"Restart Time: ",asctime(localtime(&restart_time)),"<br>\n",
  	       NULL);
Index: http_protocol.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/http_protocol.c,v
retrieving revision 1.98
diff -c -r1.98 http_protocol.c
*** 1.98	1997/02/06 21:40:35
--- http_protocol.c	1997/02/11 01:33:45
***************
*** 1584,1591 ****
  	char *h1 = 4 + status_lines[idx];
  	BUFF *fd = c->client;
  	
!         bvputs(fd,"<HEAD><TITLE>", title, "</TITLE></HEAD>\n<BODY><H1>",
h1,
! 	       "</H1>\n", NULL);
  	
          switch (status) {
  	case REDIRECT:
--- 1584,1600 ----
  	char *h1 = 4 + status_lines[idx];
  	BUFF *fd = c->client;
  	
!         bvputs
! 	    (
! 		fd,
! 		"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n",
! 		"<HTML>\n<HEAD>\n<TITLE>",
! 		title,
! 		"</TITLE>\n</HEAD>\n<BODY>\n<H1>",
! 		h1,
! 	       "</H1>\n",
! 	       NULL
! 	    );
  	
          switch (status) {
  	case REDIRECT:
***************
*** 1718,1724 ****
  	    bputs("while trying to use an ErrorDocument to\n", fd);
  	    bputs("handle the request.\n", fd);
  	}
! 	bputs("</BODY>\n", fd);
      }
          
  }
--- 1727,1733 ----
  	    bputs("while trying to use an ErrorDocument to\n", fd);
  	    bputs("handle the request.\n", fd);
  	}
! 	bputs("</BODY>\n</HTML>\n", fd);
      }
          
  }

Mime
View raw message