httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@hyperreal.com>
Subject mod_imap patch - please review
Date Tue, 30 Apr 1996 03:17:19 GMT

mod_imap.c was apparently only giving relative URL's in the Location: 
header in 302 responses if relative links were given in the map file.  
I.e. a map file containing

rect /foobar.html 0,0 200,200

would return a 

302 Found
Location: /footer.html

or even worse, without the beginning slash,

Location: footer.html

This patch should fix this.  When the "defaults" are getting set, the 
third call to imap_uri from imap_handler was missing the 
"http://servername/" stuff, and it's there now.  Will people familiar 
with the imap module please double-check this.  Thanks.

	Brian


*** mod_imap.c.old	Mon Apr 29 20:09:43 1996
--- mod_imap.c	Mon Apr 29 20:12:05 1996
***************
*** 384,392 ****
  
    if ( ! base || ! *base ) {
      if ( value && *value ) {  
!       strcpy(url, value);   /* no base: use what is given */
      }         
!     else {                  
        if (r->server->port == 80 ) {  
  	sprintf(url, "http://%s/", r->server->server_hostname);
        }            
--- 384,399 ----
  
    if ( ! base || ! *base ) {
      if ( value && *value ) {  
!       /* no base: use what is given, making sure it's relative to the request */
!       if (r->server->port == 80 ) {  
! 	sprintf(url, "http://%s%s", r->server->server_hostname, value);
!       }            
!       if (r->server->port != 80 ) {
! 	sprintf(url, "http://%s:%d%s", r->server->server_hostname, 
! 		r->server->port, value);
!       } 
      }         
!     else {   /* no base, no value: pick a simple default */
        if (r->server->port == 80 ) {  
  	sprintf(url, "http://%s/", r->server->server_hostname);
        }            


Mime
View raw message