Changeset 433

Show
Ignore:
Timestamp:
07/09/2005 08:17:40 PM (3 years ago)
Author:
jan
Message:

ah, don't care about the valid chars, control-chars, 127 and 255 are out

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.3.x/src/request.c

    r379 r433  
    260260} 
    261261 
    262 int request_uri_is_valid_char(char c) { 
    263         /* RFC 2396 - Appendix A */ 
    264          
    265         /* alphanum */ 
    266         if (light_isalnum(c)) return 1; 
    267         if (c < 0) return 1; /* no-ascii chars are ok */ 
    268          
    269         switch(c) { 
    270                 /* reserved */ 
    271         case ';': 
    272         case '/': 
    273         case '?':  
    274         case ':': 
    275         case '@': 
    276         case '&': 
    277         case '=': 
    278         case '+': /* only in Query part it is rewritten to ' ' (space) */ 
    279         case '$': 
    280         case ',': 
    281                  
    282                 /* mark */ 
    283         case '-': 
    284         case '_': 
    285         case '.': 
    286         case '!': 
    287         case '~': 
    288         case '*': 
    289         case '\'': 
    290         case '(': 
    291         case ')': 
    292                  
    293                 /* escaped */ 
    294         case '%': 
    295                  
    296                 /* fragment, should not be out in the wild $*/ 
    297         case '#':  
    298                  
    299                 /* non RFC */ 
    300         case '[':  
    301         case ']': 
    302         case '|':        
    303                 return 1; 
    304         } 
    305          
    306         return 0; 
     262int request_uri_is_valid_char(unsigned char c) { 
     263        if (c <= 32) return 0; 
     264        if (c == 127) return 0; 
     265        if (c == 255) return 0; 
     266         
     267        return 1; 
    307268} 
    308269