Changeset 945
- Timestamp:
- 11/02/07 23:32:59 (1 year ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/handler_common.c (modified) (5 diffs)
- cherokee/trunk/cherokee/handler_common.h (modified) (1 diff)
- cherokee/trunk/qa/149-Common-PathInfo.py (added)
- cherokee/trunk/qa/150-Common-No-PathInfo.py (added)
- cherokee/trunk/qa/Makefile.am (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r944 r945 1 2007-11-02 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * qa/149-Common-PathInfo.py, qa/150-Common-No-PathInfo.py: Added 4 two new QA tests to ensure that the latest change works. 5 6 * cherokee/handler_common.c, cherokee/handler_common.h: Added new 7 configuration key "allow_pathinfo". 8 1 9 2007-10-29 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 10 cherokee/trunk/cherokee/handler_common.c
r869 r945 47 47 48 48 #define ENTRIES "handler,common" 49 49 #define DEFAULT_ALLOW_PATHINFO true 50 50 51 51 ret_t … … 69 69 cherokee_handler_common_configure (cherokee_config_node_t *conf, cherokee_server_t *srv, cherokee_module_props_t **_props) 70 70 { 71 ret_t ret; 71 ret_t ret; 72 cherokee_config_node_t *subconf; 72 73 cherokee_handler_common_props_t *props; 73 74 … … 78 79 MODULE_PROPS_FREE(cherokee_handler_common_props_free)); 79 80 80 n->props_file = NULL; 81 n->props_dirlist = NULL; 81 n->props_file = NULL; 82 n->props_dirlist = NULL; 83 n->allow_pathinfo = DEFAULT_ALLOW_PATHINFO; 82 84 83 85 *_props = MODULE_PROPS(n); … … 86 88 props = PROP_COMMON(*_props); 87 89 90 /* Parse 'common' parameters 91 */ 92 ret = cherokee_config_node_get (conf, "allow_pathinfo", &subconf); 93 if (ret == ret_ok) { 94 props->allow_pathinfo = atoi(subconf->val.buf); 95 } 96 97 /* Parse 'file' parameters 98 */ 88 99 ret = cherokee_handler_file_configure (conf, srv, (cherokee_module_props_t **)&props->props_file); 89 100 if ((ret != ret_ok) && (ret != ret_deny)) return ret; 90 101 102 /* Parse 'dirlist' parameters 103 */ 91 104 return cherokee_handler_dirlist_configure (conf, srv, (cherokee_module_props_t **)&props->props_dirlist); 92 105 } … … 183 196 int begin; 184 197 198 /* If PathInfo is not allowed just return 'Not Found' 199 */ 200 if (! PROP_COMMON(props)->allow_pathinfo) { 201 conn->error_code = http_not_found; 202 return ret_error; 203 } 204 185 205 /* Maybe it could stat() the file because the request contains 186 206 * a PathInfo string at the end.. cherokee/trunk/cherokee/handler_common.h
r597 r945 34 34 typedef struct { 35 35 cherokee_module_props_t base; 36 cherokee_boolean_t allow_pathinfo; 36 37 cherokee_handler_file_props_t *props_file; 37 38 cherokee_handler_dirlist_props_t *props_dirlist; cherokee/trunk/qa/Makefile.am
r852 r945 153 153 146-ContentRange4-NoIO.py \ 154 154 147-ContentRange-Double-NoIO.py \ 155 148-ContentRange-Double2-NoIO.py 155 148-ContentRange-Double2-NoIO.py \ 156 149-Common-PathInfo.py \ 157 150-Common-No-PathInfo.py 156 158 157 159 test: