diff options
| author | erdgeist <> | 2007-01-24 21:49:41 +0000 |
|---|---|---|
| committer | erdgeist <> | 2007-01-24 21:49:41 +0000 |
| commit | bcef9d56a43ff15eb80f0c077adefa94afe60392 (patch) | |
| tree | 59ccc417a41227c45508bd06c363005b8a78b477 | |
| parent | c2ed48f73b625f39c6b61c7e0710fd941dc92f9d (diff) | |
Allowing more relaxed parsing of queries
| -rw-r--r-- | scan_urlencoded_query.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scan_urlencoded_query.c b/scan_urlencoded_query.c index 8cea507..ff38246 100644 --- a/scan_urlencoded_query.c +++ b/scan_urlencoded_query.c | |||
| @@ -10,8 +10,13 @@ | |||
| 10 | unreserved = alphanum | mark | 10 | unreserved = alphanum | mark |
| 11 | mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" | 11 | mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" |
| 12 | we add '%' to the matrix to not stop at encoded chars. | 12 | we add '%' to the matrix to not stop at encoded chars. |
| 13 | After losing too many requests to being too strict, add the following characters to reserved matrix | ||
| 14 | relax = "+" | "," | "/" | ";" | "<" | ">" | ||
| 15 | |||
| 16 | static const unsigned char reserved_matrix_strict[] = { 0xA2, 0x67, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; | ||
| 13 | */ | 17 | */ |
| 14 | static const unsigned char reserved_matrix[] = { 0xA2, 0x67, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; | 18 | static const unsigned char reserved_matrix[] = { 0xA2, 0xFF, 0xFF, 0x5B, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x47}; |
| 19 | |||
| 15 | static int is_unreserved( unsigned char c ) { | 20 | static int is_unreserved( unsigned char c ) { |
| 16 | if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7)); | 21 | if( ( c <= 32 ) || ( c >= 127 ) ) return 0; return 1&(reserved_matrix[(c-32)>>3]>>(c&7)); |
| 17 | } | 22 | } |
