fielding 97/03/07 06:35:48
Modified: src CHANGES util.c
Log:
Made is_url() allow "[-.+a-zA-Z0-9]+:" as a valid scheme and
not reject URLs without a double-slash, as per RFC2068 section 3.2.
Submitted by: Ken Coar, closes PR #146, #187
Reviewed by: Roy Fielding, Dean Gaudet, Jim Jagielski
Revision Changes Path
1.188 +4 -0 apache/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache/src/CHANGES,v
retrieving revision 1.187
retrieving revision 1.188
diff -C3 -r1.187 -r1.188
*** CHANGES 1997/03/07 14:15:35 1.187
--- CHANGES 1997/03/07 14:35:46 1.188
***************
*** 1,5 ****
--- 1,9 ----
Changes with Apache 1.2b8
+ *) Made is_url() allow "[-.+a-zA-Z0-9]+:" as a valid scheme and
+ not reject URLs without a double-slash, as per RFC2068 section 3.2.
+ [Ken Coar] PR #146, #187
+
*) Added table entry placeholder for new header_parser callback
in all of the distributed modules. [Ken Coar] PR #191
1.48 +10 -5 apache/src/util.c
Index: util.c
===================================================================
RCS file: /export/home/cvs/apache/src/util.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C3 -r1.47 -r1.48
*** util.c 1997/03/06 00:19:54 1.47
--- util.c 1997/03/07 14:35:46 1.48
***************
*** 904,919 ****
else return pstrcat (a, src1, src2, NULL);
}
int is_url(const char *u) {
register int x;
! for(x=0;u[x] != ':';x++)
! if((!u[x]) || (!isalpha(u[x])))
return 0;
! if((u[x+1] == '/') && (u[x+2] == '/'))
! return 1;
! else return 0;
}
int can_exec(const struct stat *finfo) {
--- 904,924 ----
else return pstrcat (a, src1, src2, NULL);
}
+ /*
+ * Check for an absoluteURI syntax (see section 3.2 in RFC2068).
+ */
int is_url(const char *u) {
register int x;
! for (x = 0; u[x] != ':'; x++) {
! if ((! u[x]) ||
! ((! isalpha(u[x])) && (! isdigit(u[x])) &&
! (u[x] != '+') && (u[x] != '-') && (u[x] != '.'))) {
return 0;
+ }
+ }
! return (x ? 1 : 0); /* If the first character is ':', it's broken, too
*/
}
int can_exec(const struct stat *finfo) {