You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Behlendorf <br...@hyperreal.com> on 1996/04/30 05:17:19 UTC

mod_imap patch - please review

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);
        }