Subject: http-gw 2.1 patch for URL scheme case insensitivity

From: Liudvikas Bukys <[email-masked]>
Date: Fri, 8 Sep 2000 14:14:42 -0400 (EDT)

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

According to RFC1738 http://www.ietf.org/rfc/rfc1738.txt?number=1738

``	For resiliency, programs interpreting URLs should treat upper
	case letters as equivalent to lower case in scheme names (e.g.,
	allow "HTTP" as well as "http").	''

Liudvikas Bukys
University of Rochester
734 Computer Studies Building
Rochester, NY 14627-0226

tel# 716-275-7747
fax# 716-273-4556

<[email-masked]>
<[email-masked]>
<[email-masked]>

*** http-gw.c	1998/09/24 14:53:52	1.1
--- http-gw.c	2000/09/08 15:17:49
***************
*** 436,438 ****
  	if( parse_vec[3] == NULL){
! 		if( ourport && !strcmp(parse_vec[2], ourname)){
  			sprintf(url_port,"%d", ourport);
--- 436,438 ----
  	if( parse_vec[3] == NULL){
! 		if( ourport && !strcasecmp(parse_vec[2], ourname)){
  			sprintf(url_port,"%d", ourport);
***************
*** 637,639 ****
  /* Now look for our special formats (URL's) */
! 	if( !strncmp(path, "gopher://", 9)){
  		ret &= ~MASK_BASE;
--- 637,639 ----
  /* Now look for our special formats (URL's) */
! 	if( !strncasecmp(path, "gopher://", 9)){
  		ret &= ~MASK_BASE;
***************
*** 657,659 ****
  		return ret;
! 	}else if( !strncmp(path, "http://", 7)){
  		ret &= ~MASK_BASE;
--- 657,659 ----
  		return ret;
! 	}else if( !strncasecmp(path, "http://", 7)){
  		ret &= ~MASK_BASE;
***************
*** 668,670 ****
  
! 	}else if( !strncmp(path, "ftp://", 6) || !strncmp(path, "file://", 7)){
  		ret &= ~MASK_BASE;
--- 668,670 ----
  
! 	}else if( !strncasecmp(path, "ftp://", 6) || !strncasecmp(path, "file://", 7)){
  		ret &= ~MASK_BASE;
***************
*** 764,766 ****
  	case 'e':
! 		if(strncmp(buf, "exec:", 5)== 0){
  			ret = TYPE_EXEC;
--- 764,766 ----
  	case 'e':
! 		if(strncasecmp(buf, "exec:", 5)== 0){
  			ret = TYPE_EXEC;
***************
*** 770,772 ****
  	case 'f':
! 		if(strncmp(buf, "ftp:", 4) == 0){
  			ret = parse_ftp(buf);
--- 770,772 ----
  	case 'f':
! 		if(strncasecmp(buf, "ftp:", 4) == 0){
  			ret = parse_ftp(buf);
***************
*** 776,781 ****
  	case 'w':
! 		if(strncmp(buf, "waissrc:", 8)== 0){
  			ret = TYPE_WAIS|TYPE_DIR;
  		}
! 		if( strncmp(buf, "waisdocid:", 10) == 0){
  			ret = TYPE_WAIS;
--- 776,781 ----
  	case 'w':
! 		if(strncasecmp(buf, "waissrc:", 8)== 0){
  			ret = TYPE_WAIS|TYPE_DIR;
  		}
! 		if( strncasecmp(buf, "waisdocid:", 10) == 0){
  			ret = TYPE_WAIS;